diff options
author | Brian Durand <bbdurand@gmail.com> | 2018-05-03 17:27:20 -0700 |
---|---|---|
committer | Brian Durand <bbdurand@gmail.com> | 2018-05-04 10:21:17 -0700 |
commit | a779b1a08bb73be2b50d42ae69b3946de98e5af4 (patch) | |
tree | 79ef12cdb86f5730ad2c0d0171bdaf6b609b35ce /activerecord/CHANGELOG.md | |
parent | 98c1432583d4607af1467425183d8d448a692c5a (diff) | |
download | rails-a779b1a08bb73be2b50d42ae69b3946de98e5af4.tar.gz rails-a779b1a08bb73be2b50d42ae69b3946de98e5af4.tar.bz2 rails-a779b1a08bb73be2b50d42ae69b3946de98e5af4.zip |
Fix logic on disabling commit callbacks
Commit callbacks are intentionally disabled when errors occur when calling the callback chain in order to reset the internal record state. However, the implicit order of operations on the logic for checking if callbacks are disabled is wrong. The result is that callbacks can be unexpectedly when errors occur in transactions.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 36a3d59784..dda7d19915 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,7 @@ +* Fix logic on disabling commit callbacks so they are not called unexpectedly when errors occur. + + *Brian Durand* + * Ensure `Associations::CollectionAssociation#size` and `Associations::CollectionAssociation#empty?` use loaded association ids if present. |