From abce1aa289dca3afef2a2f48567bc18d6c623d61 Mon Sep 17 00:00:00 2001 From: Joey Geiger Date: Thu, 29 Jan 2015 09:26:44 -0700 Subject: 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. --- activesupport/lib/active_support/values/time_zone.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport/lib') 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 -- cgit v1.2.3