diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-10 16:21:16 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-10 16:42:16 +0900 |
commit | faf07d1468af06bb3f7f5dd0776d77dd252af3b6 (patch) | |
tree | 6bdffd96373b85eb852e6b5795c5c101eed916ac /activerecord/CHANGELOG.md | |
parent | 7cb3e8b8efb193c13281c0d6c0354bbcc91c3b8e (diff) | |
parent | 332e7601a98ebff6a7494a556c7fe97c5691f085 (diff) | |
download | rails-faf07d1468af06bb3f7f5dd0776d77dd252af3b6.tar.gz rails-faf07d1468af06bb3f7f5dd0776d77dd252af3b6.tar.bz2 rails-faf07d1468af06bb3f7f5dd0776d77dd252af3b6.zip |
Merge pull request #28155 from lcreid/belongs_to
Fix "autosave: true" on belongs_to of join model causes invalid records to be saved
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 3096f7846a..1cf3f3352f 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,17 @@ +* Fix circular `autosave: true` causes invalid records to be saved. + + Prior to the fix, when there was a circular series of `autosave: true` + associations, the callback for a `has_many` association was run while + another instance of the same callback on the same association hadn't + finished running. When control returned to the first instance of the + callback, the instance variable had changed, and subsequent associated + records weren't saved correctly. Specifically, the ID field for the + `belongs_to` corresponding to the `has_many` was `nil`. + + Fixes #28080. + + *Larry Reid* + * Raise `ArgumentError` for invalid `:limit` and `:precision` like as other options. Before: |