From 7ee9addb6edc6d231ab5d95a24964a56b0b175d0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 19 Nov 2008 11:51:57 -0800 Subject: Enumerable#none? conforms to Ruby 1.8.7 behavior --- activesupport/lib/active_support/core_ext/enumerable.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/enumerable.rb') diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index 26596d838d..a7eaccfed7 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -106,11 +106,11 @@ module Enumerable end # Returns true if none of the elements match the given block. - # + # # success = responses.none? {|r| r.status / 100 == 5 } # + # This is a builtin method in Ruby 1.8.7 and later. def none?(&block) - return true if !block_given? || blank? !any?(&block) - end + end unless [].respond_to?(:none?) end -- cgit v1.2.3