Permalink
Browse files

Merge pull request #7061 from davidcelis/master

Update the documentation for the :autosave option on belongs_to
  • Loading branch information...
2 parents 891043d + 230d7f7 commit 764deabd85964e4d64976ca0c3fc3a96faeb66a2 @vijaydev vijaydev committed Aug 23, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/associations.rb
@@ -1137,7 +1137,9 @@ module ClassMethods
# [: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]

0 comments on commit 764deab

Please sign in to comment.