aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/duration.rb
diff options
context:
space:
mode:
authorlsylvester <lachlan.sylvester@hypothetical.com.au>2014-10-03 19:53:54 +1000
committerlsylvester <lachlan.sylvester@hypothetical.com.au>2014-10-03 19:53:54 +1000
commit6c57c78671ef49922643361cfb0a9287986be904 (patch)
tree1acdaf78dc69bc92c3843c353708e3f3f409203a /activesupport/lib/active_support/duration.rb
parentde50a91daad90bf2a0e6bece60a1c2211ade4682 (diff)
downloadrails-6c57c78671ef49922643361cfb0a9287986be904.tar.gz
rails-6c57c78671ef49922643361cfb0a9287986be904.tar.bz2
rails-6c57c78671ef49922643361cfb0a9287986be904.zip
define hash on duration
Diffstat (limited to 'activesupport/lib/active_support/duration.rb')
-rw-r--r--activesupport/lib/active_support/duration.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb
index e861a17426..584fc1e1c5 100644
--- a/activesupport/lib/active_support/duration.rb
+++ b/activesupport/lib/active_support/duration.rb
@@ -63,6 +63,10 @@ module ActiveSupport
Duration === other && other.value.eql?(value)
end
+ def hash
+ @value.hash
+ end
+
def self.===(other) #:nodoc:
other.is_a?(Duration)
rescue ::NoMethodError