Skip to content

Commit

Permalink
Restrict changed attributes to attributes that have a corresponding d…
Browse files Browse the repository at this point in the history
…atabase column
  • Loading branch information
joshmcarthur committed Jul 2, 2013
1 parent f25e320 commit 4ae9a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paper_trail/has_paper_trail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def item_before_change
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

Expand Down

0 comments on commit 4ae9a26

Please sign in to comment.