Fix don't create trail on destroy if record was not persisted
This commit is contained in:
parent
bfe96a71a4
commit
3ff8dff7dc
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue