diff options
author | Matthew Draper <matthew@trebex.net> | 2017-07-01 22:33:27 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 22:33:27 +0930 |
commit | e469e9dfac933d66ae4f7aae152aeb5c4be80bc7 (patch) | |
tree | 052452cd7f299923c18ef8163b054a08dc6c71ab /activerecord/test | |
parent | e1784c2e008a1150a1ee8b18d21ad3795e985e66 (diff) | |
parent | 131ed24f5ef41f5470e83fb66cfff61f635bf24d (diff) | |
download | rails-e469e9dfac933d66ae4f7aae152aeb5c4be80bc7.tar.gz rails-e469e9dfac933d66ae4f7aae152aeb5c4be80bc7.tar.bz2 rails-e469e9dfac933d66ae4f7aae152aeb5c4be80bc7.zip |
Merge pull request #29631 from kamipo/should_be_clear_association_ids
Should be clear `@association_ids` when joined newly associated record
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 84c359f2f0..a7e16af88d 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -2558,6 +2558,11 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal [bulb.id], car.bulb_ids assert_no_queries { car.bulb_ids } + + bulb2 = car.bulbs.create! + + assert_equal [bulb.id, bulb2.id], car.bulb_ids + assert_no_queries { car.bulb_ids } end def test_loading_association_in_validate_callback_doesnt_affect_persistence |