1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Fix reify method

Handle case old version has attribute with same name with current model setter
This commit is contained in:
Vinh Bachsy 2014-09-29 14:24:46 +07:00
parent 8ce602cb78
commit 091b78e1d0

View file

@ -149,7 +149,7 @@ module PaperTrail
# Set all the attributes in this version on the model
attrs.each do |k, v|
if model.respond_to?("#{k}=")
if model.has_attribute?(k)
model[k.to_sym] = v
else
logger.warn "Attribute #{k} does not exist on #{item_type} (Version id: #{id})."