From 2af0b6c72c93b95a70ba233babec553769f448dc Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 14 Mar 2016 15:34:32 -0400 Subject: [PATCH] Add "Reserved Word Attributes" section to GETTING_STARTED.md see issue #879 --- GETTING_STARTED.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 8e0ab9b..9111c42 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -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 ------------