Permalink
Browse files

TimeWithZone: use Array#any? instead of detect, since we don't care a…

…bout the block return value
  • Loading branch information...
1 parent 18d6369 commit 5394fcb19a0ee5ecb2f34543027260fc4eb931da @gbuesing gbuesing committed Feb 9, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/time_with_zone.rb
@@ -328,7 +328,7 @@ def transfer_time_values_to_utc_constructor(time)
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

0 comments on commit 5394fcb

Please sign in to comment.