aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-08-23 08:12:17 -0700
committerVijay Dev <vijaydev.cse@gmail.com>2012-08-23 08:12:17 -0700
commit764deabd85964e4d64976ca0c3fc3a96faeb66a2 (patch)
treeef03347d8ebca3ecdd841c953e305819279027c3 /activerecord/lib/active_record/associations.rb
parent891043d5d0d097fc51c3fccdfa563c3ba52b7f55 (diff)
parent230d7f760030c3400b682e4d8ffa1292ac1a9682 (diff)
downloadrails-764deabd85964e4d64976ca0c3fc3a96faeb66a2.tar.gz
rails-764deabd85964e4d64976ca0c3fc3a96faeb66a2.tar.bz2
rails-764deabd85964e4d64976ca0c3fc3a96faeb66a2.zip
Merge pull request #7061 from davidcelis/master
Update the documentation for the :autosave option on belongs_to
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rw-r--r--activerecord/lib/active_record/associations.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 9ba3323bc7..d6b8552e6e 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1137,7 +1137,9 @@ module ActiveRecord
# [:autosave]
# 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.
+ # By default, only save associated objects that are new records. This option is implemented as a
+ # before_save callback. Because callbacks are run in the order they are defined, associated objects
+ # may need to be explicitly saved in any user-defined before_save callbacks.
#
# Note that <tt>accepts_nested_attributes_for</tt> sets <tt>:autosave</tt> to <tt>true</tt>.
# [:inverse_of]