Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

No need for an extra wrapper array.

  • Loading branch information...
commit 4c360c15e53324a7e5940f943129a06da51ac7d3 1 parent e12e2fb
@thedarkone thedarkone authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/core_ext/hash/keys.rb
View
2  activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -39,7 +39,7 @@ def symbolize_keys!
# { :name => "Rob", :age => "28" }.assert_valid_keys("name", "age") # => raises "ArgumentError: Unknown key(s): name, age"
# { :name => "Rob", :age => "28" }.assert_valid_keys(:name, :age) # => passes, raises nothing
def assert_valid_keys(*valid_keys)
- unknown_keys = keys - [valid_keys].flatten
+ unknown_keys = keys - valid_keys.flatten
raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty?
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.