aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-29 14:38:45 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-29 14:38:45 -0200
commitb344986bc3d94ca7821fc5e0eef1874882ac6cbb (patch)
treede176d78d739465a5c9598036715b37bfb70c413
parent37f2defa9922e915ac021f303d1b0e3bcbafcd79 (diff)
parentabce1aa289dca3afef2a2f48567bc18d6c623d61 (diff)
downloadrails-b344986bc3d94ca7821fc5e0eef1874882ac6cbb.tar.gz
rails-b344986bc3d94ca7821fc5e0eef1874882ac6cbb.tar.bz2
rails-b344986bc3d94ca7821fc5e0eef1874882ac6cbb.zip
Merge pull request #18718 from jgeiger/fix_ruby_2_2_comparable_warnings
Fix ruby 2.2 comparable warnings
-rw-r--r--activerecord/lib/active_record/fixtures.rb2
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 1e6b5c5d69..d6eafb16b7 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -589,7 +589,7 @@ module ActiveRecord
# interpolate the fixture label
row.each do |key, value|
- row[key] = label if value == "$LABEL"
+ row[key] = label if value.is_a?(String) && value == "$LABEL"
end
# generate a primary key if necessary
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