diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index a54494bc65..e861a17426 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -57,8 +57,10 @@ module ActiveSupport @value.to_s end + # Returns +true+ if +other+ is also a Duration instance, which has the + # same parts as this one. def eql?(other) - other.is_a?(Duration) && self == other + Duration === other && other.value.eql?(value) end def self.===(other) #:nodoc: |