aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-11-07 16:43:25 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-11-07 16:43:25 -0800
commitcb976371e43c90a995afb1224c325c7eed4fc194 (patch)
tree539aafbaeace6c5e099ecda899a8c7ccc958077f /activesupport/lib/active_support
parentc2fc9848b1495768a4c550e4cc532882146902c9 (diff)
parent2e085f67d4132ac8e01dae5a4428014f51fd4829 (diff)
downloadrails-cb976371e43c90a995afb1224c325c7eed4fc194.tar.gz
rails-cb976371e43c90a995afb1224c325c7eed4fc194.tar.bz2
rails-cb976371e43c90a995afb1224c325c7eed4fc194.zip
Merge pull request #17493 from petewest/duration-comparable
Delegate comparison operator to value
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/duration.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb
index baa83223d2..0de1d2c7df 100644
--- a/activesupport/lib/active_support/duration.rb
+++ b/activesupport/lib/active_support/duration.rb
@@ -102,6 +102,8 @@ module ActiveSupport
@value.respond_to?(method, include_private)
end
+ delegate :<=>, to: :value
+
protected
def sum(sign, time = ::Time.current) #:nodoc: