aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-12-03 00:15:34 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-12-03 00:15:34 -0200
commitc48a0cac626b4e32d7abfa9f4f1fae16568157d9 (patch)
tree27b92e5f814ecaea9b5f11f0f5f9723a5ee9f63d /activesupport/lib/active_support/core_ext/hash
parent2ebf47aea21ff8ac10681e53e78dd7a0e5c31c6e (diff)
downloadrails-c48a0cac626b4e32d7abfa9f4f1fae16568157d9.tar.gz
rails-c48a0cac626b4e32d7abfa9f4f1fae16568157d9.tar.bz2
rails-c48a0cac626b4e32d7abfa9f4f1fae16568157d9.zip
Tidy up previous commit, fix message assertion and improve tests
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/keys.rb4
1 files changed, 3 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 d31bbd5c88..93e716585b 100644
--- a/activesupport/lib/active_support/core_ext/hash/keys.rb
+++ b/activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -67,7 +67,9 @@ class Hash
def assert_valid_keys(*valid_keys)
valid_keys.flatten!
each_key do |k|
- raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}") unless valid_keys.include?(k)
+ unless valid_keys.include?(k)
+ raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}")
+ end
end
end