diff options
author | Matthew Draper <matthew@trebex.net> | 2017-02-21 05:24:18 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 05:24:18 +1030 |
commit | eb41ac40cb05874863ce24f0c2547b191db1211c (patch) | |
tree | 1503ba43dc7905254c7e797c90dc8a1757aa0de4 /activerecord/test/cases/associations/has_many_associations_test.rb | |
parent | 6c520b75286aa5969de427c5aa417061bd7c58bc (diff) | |
parent | 38c4ff377260265d96c737c51541e6ca630ea707 (diff) | |
download | rails-eb41ac40cb05874863ce24f0c2547b191db1211c.tar.gz rails-eb41ac40cb05874863ce24f0c2547b191db1211c.tar.bz2 rails-eb41ac40cb05874863ce24f0c2547b191db1211c.zip |
Merge pull request #25877 from kamipo/delegate_to_scope_rather_than_merge
Delegate to `scope` rather than `merge!` for collection proxy
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index cbecfa84ff..ede3a44090 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -611,21 +611,16 @@ class HasManyAssociationsTest < ActiveRecord::TestCase def test_update_all_on_association_accessed_before_save firm = Firm.new(name: "Firm") - clients_proxy_id = firm.clients.object_id firm.clients << Client.first firm.save! assert_equal firm.clients.count, firm.clients.update_all(description: "Great!") - assert_not_equal clients_proxy_id, firm.clients.object_id end def test_update_all_on_association_accessed_before_save_with_explicit_foreign_key - # We can use the same cached proxy object because the id is available for the scope firm = Firm.new(name: "Firm", id: 100) - clients_proxy_id = firm.clients.object_id firm.clients << Client.first firm.save! assert_equal firm.clients.count, firm.clients.update_all(description: "Great!") - assert_equal clients_proxy_id, firm.clients.object_id end def test_belongs_to_sanity |