From 800d5ae36c8a906e6fb26d4064a6a75236f84186 Mon Sep 17 00:00:00 2001 From: Bernard Potocki Date: Tue, 12 May 2015 17:48:09 +0200 Subject: ActiveSupport::HashWithIndifferentAccess select and reject should return enumerator if called without block --- activesupport/lib/active_support/hash_with_indifferent_access.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb') 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 -- cgit v1.2.3