diff options
author | thedarkone <thedarkone2@gmail.com> | 2010-09-24 23:09:12 +0200 |
---|---|---|
committer | thedarkone <thedarkone2@gmail.com> | 2010-09-27 17:45:59 +0200 |
commit | 4c360c15e53324a7e5940f943129a06da51ac7d3 (patch) | |
tree | 7c7d8fdfc1f5a63d3bf603de4a109b72d24ac3ef | |
parent | e12e2fb4f660da479110b35b375694bf267aedfb (diff) | |
download | rails-4c360c15e53324a7e5940f943129a06da51ac7d3.tar.gz rails-4c360c15e53324a7e5940f943129a06da51ac7d3.tar.bz2 rails-4c360c15e53324a7e5940f943129a06da51ac7d3.zip |
No need for an extra wrapper array.
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/keys.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |