Created
December 25, 2009 15:55
-
-
Save hakunin/263659 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
| Few things to keep in mind when starting with Datamapper. | |
| 1. new records cannot be user in hashes | |
| h = { Record.new => 1, Record.new => 2} | |
| h.values # [2] | |
| 2. dm has associations | |
| Don't try to rewrite their getters or setters. | |
| No, attributes_set does not help. | |
| 3. want a Hash as a property? | |
| Just forget about it. | |
| 4. dm doesn't save your record? | |
| Method record.save returns true/false, exceptions? You wish! | |
| Associations have default validations, add :required => false to them | |
| Those took me plenty hours to find out about, I hope you don't have to share my experience. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment