From 9dda440c38bd9878b0aa7ceb854bf4f1beeabd68 Mon Sep 17 00:00:00 2001 From: Edgars Beigarts Date: Tue, 22 Jun 2010 17:49:59 +0300 Subject: Improve documentation for assocations :autosave option. --- activerecord/lib/active_record/associations.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'activerecord/lib') 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 belongs_to association on the associated object that is the inverse of this has_many # association. Does not work in combination with :through or :as 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 belongs_to association on the associated object that is the inverse of this has_one # association. Does not work in combination with :through or :as 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 -- cgit v1.2.3