diff options
-rw-r--r-- | activerecord/test/cases/dirty_test.rb | 6 |
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 |