mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
Added test for case without object_changes column
This commit is contained in:
parent
e3890af1a6
commit
b229927c2b
2 changed files with 14 additions and 0 deletions
|
@ -47,3 +47,11 @@ def change_schema
|
|||
end
|
||||
ActiveRecord::Migration.verbose = true
|
||||
end
|
||||
|
||||
def remove_object_changes_column
|
||||
ActiveRecord::Migration.verbose = false
|
||||
ActiveRecord::Schema.define do
|
||||
remove_column :versions, :object_changes
|
||||
end
|
||||
ActiveRecord::Migration.verbose = true
|
||||
end
|
||||
|
|
|
@ -102,6 +102,12 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
|||
assert_equal ({'name' => ['Henry', 'Harry']}), @widget.versions.last.changeset
|
||||
end
|
||||
|
||||
should 'return nil after call changeset method if object_changes column doesn\'t exist' do
|
||||
remove_object_changes_column
|
||||
Version.reset_column_information
|
||||
assert_nil @widget.versions.last.changeset
|
||||
end
|
||||
|
||||
if defined?(ActiveRecord::IdentityMap) && ActiveRecord::IdentityMap.respond_to?(:without)
|
||||
should 'not clobber the IdentityMap when reifying' do
|
||||
module ActiveRecord::IdentityMap
|
||||
|
|
Loading…
Reference in a new issue