From 60410b99bd2c8e74f49fce874a93ff5e0cb78486 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Sat, 23 Jul 2011 17:21:07 +0100 Subject: [PATCH] Use existing method for slightly DRYer code. --- lib/paper_trail/has_paper_trail.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paper_trail/has_paper_trail.rb b/lib/paper_trail/has_paper_trail.rb index 7f149c46..f4bc2e8d 100644 --- a/lib/paper_trail/has_paper_trail.rb +++ b/lib/paper_trail/has_paper_trail.rb @@ -121,7 +121,7 @@ module PaperTrail :object => object_to_string(item_before_change), :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. data[:object_changes] = self.changes.reject do |key, value| !notably_changed.include?(key)