-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Callbacks
-
None
When autosaving is turned on for the child associations (e.g. when using accepts_nested_attributes_for),
when the parent document is loaded and saved after some attribute changes, all child documents are also saved (i.e. taken through the persistence process) even though none of the children changed.
The child saves don't write anything to the database but go through the full persistence process on the client side including after_save callback invocations.
For example, if user has many posts, and posts are autosaved, changing an attribute on user would result in after_save callback being called on each post of that user.
Since none of the children changed, they shouldn't be going through the persistence process.