diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2014-08-23 13:09:41 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2014-08-24 18:17:46 +0200 |
commit | d5578cd17716fbda11ec37ce7489699d191878a3 (patch) | |
tree | 99b3b4d9e23c3a10500d9f9f352c568e3993adbd /activesupport/lib | |
parent | 4287f6d456518652bb1a2035c9ecf96f1be28f79 (diff) | |
download | rails-d5578cd17716fbda11ec37ce7489699d191878a3.tar.gz rails-d5578cd17716fbda11ec37ce7489699d191878a3.tar.bz2 rails-d5578cd17716fbda11ec37ce7489699d191878a3.zip |
Follow-up to #16560
For the sake of backward-compatibility, we need to make #instance_of?
return true for Fixnum. On the other hand, the method should still
give true for ActiveSupport::Duration itself which was not the case
before.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index 084d13a9e3..1a6c02a39b 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -35,12 +35,12 @@ module ActiveSupport end def is_a?(klass) #:nodoc: - instance_of?(klass) || value.is_a?(klass) + Duration == klass || value.is_a?(klass) end alias :kind_of? :is_a? def instance_of?(klass) # :nodoc: - Duration == klass + Duration == klass || value.instance_of?(klass) end # Returns +true+ if +other+ is also a Duration instance with the |