Created
March 19, 2009 15:03
-
-
Save zhhz/81857 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment