Fix don't create trail on destroy if record was not persisted

This commit is contained in:
Mikl Kurkov 2010-10-28 19:01:27 +04:00
parent bfe96a71a4
commit 3ff8dff7dc
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ module PaperTrail
end
def record_destroy
if switched_on?
if switched_on? and not new_record?
versions.create merge_metadata(:event => 'destroy',
:object => object_to_string(item_before_change),
:whodunnit => PaperTrail.whodunnit)