aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/hash_with_indifferent_access.rb
diff options
context:
space:
mode:
authorBernard Potocki <bernard.potocki@imanel.org>2015-05-12 17:48:09 +0200
committerSean Griffin <sean@thoughtbot.com>2015-07-17 17:17:23 -0400
commit800d5ae36c8a906e6fb26d4064a6a75236f84186 (patch)
tree78e241f52d2c7d495181594f3aa990085422585b /activesupport/lib/active_support/hash_with_indifferent_access.rb
parent89448a7f5c21729568eaa12250447f313197a30d (diff)
downloadrails-800d5ae36c8a906e6fb26d4064a6a75236f84186.tar.gz
rails-800d5ae36c8a906e6fb26d4064a6a75236f84186.tar.bz2
rails-800d5ae36c8a906e6fb26d4064a6a75236f84186.zip
ActiveSupport::HashWithIndifferentAccess select and reject should return enumerator if called without block
Diffstat (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 63690a1342..c5d35b84f0 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -238,10 +238,12 @@ module ActiveSupport
def to_options!; self end
def select(*args, &block)
+ return to_enum(:select) unless block_given?
dup.tap { |hash| hash.select!(*args, &block) }
end
def reject(*args, &block)
+ return to_enum(:reject) unless block_given?
dup.tap { |hash| hash.reject!(*args, &block) }
end