aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2009-02-08 22:19:46 -0600
committerGeoff Buesing <gbuesing@gmail.com>2009-02-08 22:19:46 -0600
commit5394fcb19a0ee5ecb2f34543027260fc4eb931da (patch)
treed0ac83d6fecad088939607ef727c827bfbcb76ca /activesupport/lib/active_support/time_with_zone.rb
parent18d636934492fd657a67dc980b8556bcf69a818d (diff)
downloadrails-5394fcb19a0ee5ecb2f34543027260fc4eb931da.tar.gz
rails-5394fcb19a0ee5ecb2f34543027260fc4eb931da.tar.bz2
rails-5394fcb19a0ee5ecb2f34543027260fc4eb931da.zip
TimeWithZone: use Array#any? instead of detect, since we don't care about the block return value
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 73aafc6ad3..4adf123ab2 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -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