diff options
author | Edgars Beigarts <edgars.beigarts@tieto.com> | 2010-06-22 17:49:59 +0300 |
---|---|---|
committer | Edgars Beigarts <edgars.beigarts@tieto.com> | 2010-06-22 17:49:59 +0300 |
commit | 9dda440c38bd9878b0aa7ceb854bf4f1beeabd68 (patch) | |
tree | 82e52304296c8613bbda2bf7576f48ad0d9b76dd | |
parent | 36d1e90e22c9841b146b67ece49d0744fa606e0c (diff) | |
download | rails-9dda440c38bd9878b0aa7ceb854bf4f1beeabd68.tar.gz rails-9dda440c38bd9878b0aa7ceb854bf4f1beeabd68.tar.bz2 rails-9dda440c38bd9878b0aa7ceb854bf4f1beeabd68.zip |
Improve documentation for assocations :autosave option.
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 399c1bf58a..4caa434fc0 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -886,7 +886,9 @@ module ActiveRecord # [:validate] # If false, don't validate the associated objects when saving the parent object. true by default. # [:autosave] - # If true, always save any loaded members and destroy members marked for destruction, when saving the parent object. Off by default. + # If true, always save the associated objects or destroy them if marked for destruction, when saving the parent object. + # If false, never save or destroy the associated objects. + # By default, only save associated objects that are new records. # [:inverse_of] # Specifies the name of the <tt>belongs_to</tt> association on the associated object that is the inverse of this <tt>has_many</tt> # association. Does not work in combination with <tt>:through</tt> or <tt>:as</tt> options. @@ -1001,7 +1003,9 @@ module ActiveRecord # [:validate] # If false, don't validate the associated object when saving the parent object. +false+ by default. # [:autosave] - # If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. Off by default. + # If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. + # If false, never save or destroy the associated object. + # By default, only save the associated object if it's a new record. # [:inverse_of] # Specifies the name of the <tt>belongs_to</tt> association on the associated object that is the inverse of this <tt>has_one</tt> # association. Does not work in combination with <tt>:through</tt> or <tt>:as</tt> options. @@ -1103,7 +1107,9 @@ module ActiveRecord # [:validate] # If false, don't validate the associated objects when saving the parent object. +false+ by default. # [:autosave] - # If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. Off by default. + # If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. + # If false, never save or destroy the associated object. + # By default, only save the associated object if it's a new record. # [:touch] # If true, the associated object will be touched (the updated_at/on attributes set to now) when this record is either saved or # destroyed. If you specify a symbol, that attribute will be updated with the current time instead of the updated_at/on attribute. @@ -1290,7 +1296,9 @@ module ActiveRecord # [:validate] # If false, don't validate the associated objects when saving the parent object. +true+ by default. # [:autosave] - # If true, always save any loaded members and destroy members marked for destruction, when saving the parent object. Off by default. + # If true, always save the associated objects or destroy them if marked for destruction, when saving the parent object. + # If false, never save or destroy the associated objects. + # By default, only save associated objects that are new records. # # Option examples: # has_and_belongs_to_many :projects |