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:
parent
39d2cde659
commit
61a7630891
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue