aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2018-06-11 13:06:58 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-06-11 13:10:14 -0400
commit4caf1389681a9ab74872b75377ceeb82263fe3b6 (patch)
tree4eda456cc3c0c12298c98e9149ccfefbd766fe17 /activerecord/test/cases
parentdac0e183025e2f436db9c118abdfb2ee49dada36 (diff)
downloadrails-4caf1389681a9ab74872b75377ceeb82263fe3b6.tar.gz
rails-4caf1389681a9ab74872b75377ceeb82263fe3b6.tar.bz2
rails-4caf1389681a9ab74872b75377ceeb82263fe3b6.zip
Use `-=` to change the update the collection on the association
This also mark the association as loaded given we changed it in memory and avoid the next access to the reader to make a query to the databse.
Diffstat (limited to 'activerecord/test/cases')
-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 d5573b6d02..259e4eb4b7 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(1) do
+ assert_queries(0) do
assert_empty posts(:welcome).people
end