aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values/time_zone.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-01-09 14:12:05 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-01-09 14:12:05 -0800
commitb0acc77edced44e47c8570bf7dddd4ce19f06cb0 (patch)
tree8561efa4bd47bbe5f72cd9c30e978bb767d86870 /activesupport/lib/active_support/values/time_zone.rb
parenta67f25d50b5dd9585bb10ecd19bee6a34d69de6a (diff)
downloadrails-b0acc77edced44e47c8570bf7dddd4ce19f06cb0.tar.gz
rails-b0acc77edced44e47c8570bf7dddd4ce19f06cb0.tar.bz2
rails-b0acc77edced44e47c8570bf7dddd4ce19f06cb0.zip
Check `respond_to` before delegation due to: https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314
Diffstat (limited to 'activesupport/lib/active_support/values/time_zone.rb')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index 8ca4973162..beaac42fa1 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -234,6 +234,7 @@ module ActiveSupport
# Compare this time zone to the parameter. The two are compared first on
# their offsets, and then by name.
def <=>(zone)
+ return unless zone.respond_to? :utc_offset
result = (utc_offset <=> zone.utc_offset)
result = (name <=> zone.name) if result == 0
result