mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
Merge pull request #480 from TMaYaD/patch-1
Avoid looking up item when reifying with dup: true
This commit is contained in:
commit
1c535b24ca
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@ module PaperTrail
|
|||
# `item_type` will be the base class, not the actual subclass.
|
||||
# If `type` is present but empty, the class is the base class.
|
||||
|
||||
if item && options[:dup] != true
|
||||
if options[:dup] != true && item
|
||||
model = item
|
||||
# Look for attributes that exist in the model and not in this version. These attributes should be set to nil.
|
||||
(model.attribute_names - attrs.keys).each { |k| attrs[k] = nil }
|
||||
|
|
Loading…
Reference in a new issue