Permalink
Browse files

Fix deprecation warning when reifying a version.

Closes #135.
  • Loading branch information...
1 parent 096c2c6 commit df007eef684020d174be8b906afb71842cb1a337 @airblade airblade committed Mar 13, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/paper_trail/version.rb
@@ -68,9 +68,9 @@ def reify(options = {})
end
attrs.each do |k, v|
- begin
- model.send :write_attribute, k.to_sym , v
- rescue NoMethodError
+ if model.respond_to?("#{k}=")
+ model.send :write_attribute, k.to_sym, v
+ else
logger.warn "Attribute #{k} does not exist on #{item_type} (Version id: #{id})."
end
end

0 comments on commit df007ee

Please sign in to comment.