Add "Reserved Word Attributes" section to GETTING_STARTED.md

see issue #879
This commit is contained in:
Andy 2016-03-14 15:34:32 -04:00 committed by Joshua Clayton
parent cd5beb02db
commit 2af0b6c72c
1 changed files with 16 additions and 0 deletions

View File

@ -253,6 +253,22 @@ you would expect. If you need to access the evaluator in a factory_girl callback
you'll need to declare a second block argument (for the evaluator) and access
transient attributes from there.
Method Name / Reserved Word Attributes
-------------------------------
If your attributes conflict with existing methods or reserved words you can define them with `add_attribute`.
```ruby
factory :dna do
add_attribute(:sequence) { 'GATTACA' }
end
factory :payment do
add_attribute(:method) { 'paypal' }
end
```
Associations
------------