aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-02-28 11:06:46 +0900
committerGitHub <noreply@github.com>2018-02-28 11:06:46 +0900
commit35b2f3a8b166ba930770fbf21ae694f420a78fdb (patch)
tree9c75cb39239f786ee09ba9db0f293db0b8aa4a06
parent39d2cde65919729ec1ca3663d7872adf8036fd58 (diff)
parent61a76308913c992cfccb2a47e579203400df57ba (diff)
downloadrails-35b2f3a8b166ba930770fbf21ae694f420a78fdb.tar.gz
rails-35b2f3a8b166ba930770fbf21ae694f420a78fdb.tar.bz2
rails-35b2f3a8b166ba930770fbf21ae694f420a78fdb.zip
Merge pull request #32134 from bogdanvlviv/use-with_partial_writes
Use `with_partial_writes` helper in `activerecord/test/cases/dirty_test.rb`
-rw-r--r--activerecord/test/cases/dirty_test.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index 0791811d94..2f1434b2bc 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -737,9 +737,7 @@ class DirtyTest < ActiveRecord::TestCase
end
test "virtual attributes are not written with partial_writes off" do
- original_partial_writes = ActiveRecord::Base.partial_writes
- begin
- ActiveRecord::Base.partial_writes = false
+ with_partial_writes(ActiveRecord::Base, false) do
klass = Class.new(ActiveRecord::Base) do
self.table_name = "people"
attribute :non_persisted_attribute, :string
@@ -753,8 +751,6 @@ class DirtyTest < ActiveRecord::TestCase
record.non_persisted_attribute_will_change!
assert record.save
- ensure
- ActiveRecord::Base.partial_writes = original_partial_writes
end
end