Skip to content
This repository
Browse code

Mention effect of accepts_nested_attributes_for on association autosa…

…ve option [ci skip]
  • Loading branch information...
commit 456489f709cbf74fafd5428fc047b5ab90d906fc 1 parent 8371b0b
Chris Gunther authored June 27, 2012
8  activerecord/lib/active_record/associations.rb
@@ -1167,6 +1167,8 @@ module ClassMethods
1167 1167
       #   If true, always save the associated objects or destroy them if marked for destruction,
1168 1168
       #   when saving the parent object. If false, never save or destroy the associated objects.
1169 1169
       #   By default, only save associated objects that are new records.
  1170
+      #
  1171
+      #   Note that <tt>accepts_nested_attributes_for</tt> sets <tt>:autosave</tt> to <tt>true</tt>.
1170 1172
       # [:inverse_of]
1171 1173
       #   Specifies the name of the <tt>belongs_to</tt> association on the associated object
1172 1174
       #   that is the inverse of this <tt>has_many</tt> association. Does not work in combination
@@ -1288,6 +1290,8 @@ def has_many(name, options = {}, &extension)
1288 1290
       #   If true, always save the associated object or destroy it if marked for destruction,
1289 1291
       #   when saving the parent object. If false, never save or destroy the associated object.
1290 1292
       #   By default, only save the associated object if it's a new record.
  1293
+      #
  1294
+      #   Note that <tt>accepts_nested_attributes_for</tt> sets <tt>:autosave</tt> to <tt>true</tt>.
1291 1295
       # [:inverse_of]
1292 1296
       #   Specifies the name of the <tt>belongs_to</tt> association on the associated object
1293 1297
       #   that is the inverse of this <tt>has_one</tt> association. Does not work in combination
@@ -1404,6 +1408,8 @@ def has_one(name, options = {})
1404 1408
       #   saving the parent object.
1405 1409
       #   If false, never save or destroy the associated object.
1406 1410
       #   By default, only save the associated object if it's a new record.
  1411
+      #
  1412
+      #   Note that <tt>accepts_nested_attributes_for</tt> sets <tt>:autosave</tt> to <tt>true</tt>.
1407 1413
       # [:touch]
1408 1414
       #   If true, the associated object will be touched (the updated_at/on attributes set to now)
1409 1415
       #   when this record is either saved or destroyed. If you specify a symbol, that attribute
@@ -1589,6 +1595,8 @@ def belongs_to(name, options = {})
1589 1595
       #   If false, never save or destroy the associated objects.
1590 1596
       #   By default, only save associated objects that are new records.
1591 1597
       #
  1598
+      #   Note that <tt>accepts_nested_attributes_for</tt> sets <tt>:autosave</tt> to <tt>true</tt>.
  1599
+      #
1592 1600
       # Option examples:
1593 1601
       #   has_and_belongs_to_many :projects
1594 1602
       #   has_and_belongs_to_many :projects, :include => [ :milestones, :manager ]

0 notes on commit 456489f

Please sign in to comment.
Something went wrong with that request. Please try again.