From 9f431664dbec3257c898df7c4b8e8980319b14cf Mon Sep 17 00:00:00 2001 From: Franco Catena Date: Tue, 16 Nov 2010 15:34:50 -0300 Subject: [PATCH] Fix don't create trail on destroy with Rails 3.0.2 --- lib/paper_trail/has_paper_trail.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/paper_trail/has_paper_trail.rb b/lib/paper_trail/has_paper_trail.rb index 81dbcf58..5b9b9fb4 100644 --- a/lib/paper_trail/has_paper_trail.rb +++ b/lib/paper_trail/has_paper_trail.rb @@ -107,9 +107,10 @@ module PaperTrail def record_destroy if switched_on? and not new_record? - versions.create merge_metadata(:event => 'destroy', - :object => object_to_string(item_before_change), - :whodunnit => PaperTrail.whodunnit) + Version.create merge_metadata(:item => self, + :event => 'destroy', + :object => object_to_string(item_before_change), + :whodunnit => PaperTrail.whodunnit) end end