From e646d3bf574ad3ea7dc5b525511377559b2640dc Mon Sep 17 00:00:00 2001 From: Shintaro Kojima Date: Sat, 4 Apr 2015 12:24:48 +0000 Subject: Fix a regression introduced by removing unnecessary db call when replacing When replacing a has_many association with the same one, there is nothing to do with database but a setter method should still return the substituted value for backward compatibility. --- activerecord/test/cases/associations/has_many_associations_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 290b2a0d6b..171cfbde44 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1503,6 +1503,8 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_queries(0, ignore_none: true) do firm.clients = [] end + + assert_equal [], firm.send('clients=', []) end def test_transactions_when_replacing_on_persisted -- cgit v1.2.3