Permalink
Browse files

only copying over trusted attributes if they are defined

  • Loading branch information...
ryanb committed Jun 1, 2009
1 parent 3cc297f commit 008219e2862f835f3787c7129e61fb2130e915ee
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/trusted_params/hash_additions.rb
@@ -30,7 +30,7 @@ class Hash
class HashWithIndifferentAccess
def dup_with_trusted_attributes
hash = dup_without_trusted_attributes
- hash.instance_variable_set("@trusted_attributes", instance_variable_get("@trusted_attributes"))
+ hash.instance_variable_set("@trusted_attributes", @trusted_attributes) if defined?(@trusted_attributes)
hash
end
alias_method_chain :dup, :trusted_attributes

0 comments on commit 008219e

Please sign in to comment.