1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use with_partial_writes helper in activerecord/test/cases/dirty_test.rb

Related to 948b931925
This commit is contained in:
bogdanvlviv 2018-02-28 00:29:44 +02:00
parent 39d2cde659
commit 61a7630891
No known key found for this signature in database
GPG key ID: E4ACD76A6DB6DFDD

View file

@ -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