Use existing method for slightly DRYer code.
This commit is contained in:
parent
2e49b5abd0
commit
60410b99bd
|
@ -121,7 +121,7 @@ module PaperTrail
|
||||||
:object => object_to_string(item_before_change),
|
:object => object_to_string(item_before_change),
|
||||||
:whodunnit => PaperTrail.whodunnit
|
:whodunnit => PaperTrail.whodunnit
|
||||||
}
|
}
|
||||||
if self.class.version_class_name.constantize.column_names.include?('object_changes')
|
if version_class.column_names.include? 'object_changes'
|
||||||
# The double negative (reject, !include?) preserves the hash structure of self.changes.
|
# The double negative (reject, !include?) preserves the hash structure of self.changes.
|
||||||
data[:object_changes] = self.changes.reject do |key, value|
|
data[:object_changes] = self.changes.reject do |key, value|
|
||||||
!notably_changed.include?(key)
|
!notably_changed.include?(key)
|
||||||
|
|
Loading…
Reference in New Issue