TimeWithZone: use Array#any? instead of detect, since we don't care about the block return value

This commit is contained in:
Geoff Buesing
2009-02-08 22:19:46 -06:00
parent 18d6369344
commit 5394fcb19a

View File

@@ -328,7 +328,7 @@ module ActiveSupport
end
def duration_of_variable_length?(obj)
ActiveSupport::Duration === obj && obj.parts.flatten.detect {|p| [:years, :months, :days].include? p }
ActiveSupport::Duration === obj && obj.parts.flatten.any? {|p| [:years, :months, :days].include? p }
end
end
end