diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-02-28 00:29:44 +0200 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-02-28 00:32:46 +0200 |
commit | 61a76308913c992cfccb2a47e579203400df57ba (patch) | |
tree | 9c75cb39239f786ee09ba9db0f293db0b8aa4a06 /activerecord | |
parent | 39d2cde65919729ec1ca3663d7872adf8036fd58 (diff) | |
download | rails-61a76308913c992cfccb2a47e579203400df57ba.tar.gz rails-61a76308913c992cfccb2a47e579203400df57ba.tar.bz2 rails-61a76308913c992cfccb2a47e579203400df57ba.zip |
Use `with_partial_writes` helper in `activerecord/test/cases/dirty_test.rb`
Related to 948b931925febac3c965ab13470065ced68f7b53
Diffstat (limited to 'activerecord')
-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 |