aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2018-06-11 14:41:33 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-06-11 15:03:32 -0400
commit832b7a7ca330a38235d9bdecb18fa9dbf4ed156f (patch)
tree40db7275a422c942317c30ddffdd58a31bda84ce /activerecord/test
parentb05bcb8fef706ef45e2f273040083b1bbd180c6e (diff)
downloadrails-832b7a7ca330a38235d9bdecb18fa9dbf4ed156f.tar.gz
rails-832b7a7ca330a38235d9bdecb18fa9dbf4ed156f.tar.bz2
rails-832b7a7ca330a38235d9bdecb18fa9dbf4ed156f.zip
Don't use `target=`
It mark the association as loaded and this can cause the object to be in an stale state.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb2
1 files changed, 1 insertions, 1 deletions
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