Restrict changed attributes to attributes that have a corresponding database column
This commit is contained in:
parent
f25e320789
commit
4ae9a26d41
|
@ -262,7 +262,7 @@ module PaperTrail
|
|||
end
|
||||
previous.tap do |prev|
|
||||
prev.id = id
|
||||
changed_attributes.except(*self.class.paper_trail_options[:skip]).each { |attr, before| prev[attr] = before }
|
||||
changed_attributes.select { |k,v| self.class.column_names.include?(k) }.each { |attr, before| prev[attr] = before }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue