aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transactions_test.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2015-07-16 11:08:49 -0400
committerPrem Sichanugrist <s@sikac.hu>2015-07-16 16:06:26 -0400
commitb5b89796210f8893e917bf42e90ebcead8654ab9 (patch)
tree5d2f8f9491a01b88caa3e8d6aa2f32b1b526461c /activerecord/test/cases/transactions_test.rb
parent424b379c73851ac24ab707b2743de2c9d8875e2f (diff)
downloadrails-b5b89796210f8893e917bf42e90ebcead8654ab9.tar.gz
rails-b5b89796210f8893e917bf42e90ebcead8654ab9.tar.bz2
rails-b5b89796210f8893e917bf42e90ebcead8654ab9.zip
Silence deprecation warning from force reload
We deprecate the support for passing an argument to force reload in 6eae366d0d2e5d5211eeaf955f56bd1dc6836758. That led to several deprecation warning when running Active Record test suite. This commit silence the warnings by properly calling `#reload` on the association proxy or on the association object instead. However, there are several places that `ActiveSupport::Deprecation.silence` are used as those tests actually tests the force reload functionality and will be removed once `master` is targeted next minor release (5.1).
Diffstat (limited to 'activerecord/test/cases/transactions_test.rb')
-rw-r--r--activerecord/test/cases/transactions_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 2468a91969..4e163ca4a6 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -181,7 +181,7 @@ class TransactionTest < ActiveRecord::TestCase
assert posts_count > 0
status = author.update(name: nil, post_ids: [])
assert !status
- assert_equal posts_count, author.posts(true).size
+ assert_equal posts_count, author.posts.reload.size
end
def test_update_should_rollback_on_failure!
@@ -191,7 +191,7 @@ class TransactionTest < ActiveRecord::TestCase
assert_raise(ActiveRecord::RecordInvalid) do
author.update!(name: nil, post_ids: [])
end
- assert_equal posts_count, author.posts(true).size
+ assert_equal posts_count, author.posts.reload.size
end
def test_cancellation_from_returning_false_in_before_filter