From 4c360c15e53324a7e5940f943129a06da51ac7d3 Mon Sep 17 00:00:00 2001 From: thedarkone Date: Fri, 24 Sep 2010 23:09:12 +0200 Subject: No need for an extra wrapper array. --- activesupport/lib/active_support/core_ext/hash/keys.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/hash/keys.rb b/activesupport/lib/active_support/core_ext/hash/keys.rb index 045a6944fa..2cb2c89d30 100644 --- a/activesupport/lib/active_support/core_ext/hash/keys.rb +++ b/activesupport/lib/active_support/core_ext/hash/keys.rb @@ -39,7 +39,7 @@ class Hash # { :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 -- cgit v1.2.3