From d35e900c0046126d901ae9a78ce33e28f6c97644 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Sat, 20 Jul 2013 17:23:45 -0700 Subject: Restore the use of `#add_to_target` for nested attribute updates on existing records, and don't bother updating the association if the update is going to be rejected anyway. This requires adding a `skip_callbacks` argument to `#add_to_target` so that we don't call the callbacks multiple times in this case, which is functionally an application of existing association data, rather than an addition of a new record to the association. --- activerecord/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 6b3e5df1a7..e8ec99511e 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,9 @@ +* `add_to_target` now accepts a second optional `skip_callbacks` argument + + If truthy, it will skip the :before_add and :after_add callbacks. + + *Ben Woosley* + * Fix interactions between `:before_add` callbacks and nested attributes assignment of `has_many` associations, when the association was not yet loaded: -- cgit v1.2.3