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!
1. auto_migrate! vs. auto_upgrade!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee | |
include DataMapper::Resource | |
property :id, Serial | |
property :name, String | |
... | |
end | |
class Manager < Employee | |
property :position, String, :default => 'manager' | |
... | |
end | |
Manager.auto_migrate! | |
the table will have following columns: | |
id | |
name | |
Manger.auto_upgrade! | |
the table will have following columns: | |
id | |
name | |
position | |