From 558331596fbf9139ef529b14d50c6e258e63fb67 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 9 Sep 2005 08:20:14 +0000 Subject: Make assert_valid_keys slightly more lenient git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/hash/keys.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 8725138856..3c8a59f00a 100644 --- a/activesupport/lib/active_support/core_ext/hash/keys.rb +++ b/activesupport/lib/active_support/core_ext/hash/keys.rb @@ -43,8 +43,8 @@ module ActiveSupport #:nodoc: alias_method :to_options, :symbolize_keys alias_method :to_options!, :symbolize_keys! - def assert_valid_keys(valid_keys) - unknown_keys = keys - valid_keys + def assert_valid_keys(*valid_keys) + unknown_keys = keys - [valid_keys].flatten raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty? end end -- cgit v1.2.3