From 832b7a7ca330a38235d9bdecb18fa9dbf4ed156f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 11 Jun 2018 14:41:33 -0400 Subject: Don't use `target=` It mark the association as loaded and this can cause the object to be in an stale state. --- .../test/cases/associations/has_many_through_associations_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 259e4eb4b7..d5573b6d02 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -357,7 +357,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase posts(:welcome).people.delete(people(:michael)) end - assert_queries(0) do + assert_queries(1) do assert_empty posts(:welcome).people end -- cgit v1.2.3