You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Active Record Association Callbacks docs [ci skip]
This commit aims to clarify the types of arguments mentioned by the
Association Callback documentation. In some cases, `firm` arguments
implied the object was a `Firm`, but `record` arguments did not imply
any particular class.
Similarly, the `has_many` method documentation did not mention any of
the Association Callback arguments (i.e. `before_add`, `after_add`,
`before_remove`, `after_remove`). This commit includes those options in
the list and links to the more thorough documentation under the
Association Callbacks heading.
Co-authored-by: Stefanni Brasil <[email protected]>
Co-authored-by: zzak <[email protected]>
# When set to +:nested_attributes_order+, the index is based on the record order received by
1253
1275
# nested attributes setter, when accepts_nested_attributes_for is used.
1276
+
# [:before_add]
1277
+
# Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered <b>before an object is added</b> to the association collection.
1278
+
# [:after_add]
1279
+
# Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered <b>after an object is added</b> to the association collection.
1280
+
# [:before_remove]
1281
+
# Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered <b>before an object is removed</b> from the association collection.
1282
+
# [:after_remove]
1283
+
# Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered <b>after an object is removed</b> from the association collection.
0 commit comments