diff options
author | Joey Geiger <joey.geiger@irco.com> | 2015-01-29 09:26:44 -0700 |
---|---|---|
committer | Joey Geiger <joey.geiger@irco.com> | 2015-01-29 09:26:44 -0700 |
commit | abce1aa289dca3afef2a2f48567bc18d6c623d61 (patch) | |
tree | de176d78d739465a5c9598036715b37bfb70c413 /activesupport/lib/active_support/values | |
parent | 37f2defa9922e915ac021f303d1b0e3bcbafcd79 (diff) | |
download | rails-abce1aa289dca3afef2a2f48567bc18d6c623d61.tar.gz rails-abce1aa289dca3afef2a2f48567bc18d6c623d61.tar.bz2 rails-abce1aa289dca3afef2a2f48567bc18d6c623d61.zip |
Fix ruby 2.2 comparable warnings
Check for correct value type in activerecord/fixtures.rb
Check that zone can respond to expected values to make the comparison.
Diffstat (limited to 'activesupport/lib/active_support/values')
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 1 |
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 01aea0984b..37979fa3ee 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -223,6 +223,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) && zone.respond_to?(:name) result = (utc_offset <=> zone.utc_offset) result = (name <=> zone.name) if result == 0 result |