I am working on a home-grown authorization system. It is very customized for our special requirement. I have to hack DataMapper to get the job done. The more I dig in DM, the more I love it. I can't imagine how much code I have to write to do the same thing if I do it with Java. As a relative new ORM framework, it sure has some corners that might not work well for you, following are some thing I found out in one day:
1. auto_migrate! vs. auto_upgrade!
As you can see, the auto_migrate! does not create the columns in the subclass, only the superclass properties. I've found a similar ticket .
But it is pretty easy to temporally overcome this issue:
step 1: Model.all.destroy!
step 2: Model.auto_upgrade!
2. The uniq! behave differently from MRI
All that said, DM is my favorite ORM so far.
UPDATE:
Just read the comments on the ticket from Dan Kubb, the developer of DM, and the uniq! behaves the same as MRI, it will return nil if there are no duplicate elements. My bad... :-(
1. auto_migrate! vs. auto_upgrade!
As you can see, the auto_migrate! does not create the columns in the subclass, only the superclass properties. I've found a similar ticket .
But it is pretty easy to temporally overcome this issue:
step 1: Model.all.destroy!
step 2: Model.auto_upgrade!
2. The uniq! behave differently from MRI
All that said, DM is my favorite ORM so far.
UPDATE:
Just read the comments on the ticket from Dan Kubb, the developer of DM, and the uniq! behaves the same as MRI, it will return nil if there are no duplicate elements. My bad... :-(
No comments:
Post a Comment