diff options
author | Matthew Draper <matthew@trebex.net> | 2016-10-08 08:13:11 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-10-08 08:13:11 +1030 |
commit | cb0452e9a50e97f8ab2100f6226fbdd47a970a34 (patch) | |
tree | 611edac41561efabba8cb12d6839fa3f3033fc9a /activesupport/lib | |
parent | fc0b62597f9c34bd028fd91457b8865eea42cc2d (diff) | |
download | rails-cb0452e9a50e97f8ab2100f6226fbdd47a970a34.tar.gz rails-cb0452e9a50e97f8ab2100f6226fbdd47a970a34.tar.bz2 rails-cb0452e9a50e97f8ab2100f6226fbdd47a970a34.zip |
Fixnum and Bignum are deprecated in Ruby trunk
https://bugs.ruby-lang.org/issues/12739
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/numeric/conversions.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/xml_mini.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/numeric/conversions.rb b/activesupport/lib/active_support/core_ext/numeric/conversions.rb index 5ac312790d..cebfda8d31 100644 --- a/activesupport/lib/active_support/core_ext/numeric/conversions.rb +++ b/activesupport/lib/active_support/core_ext/numeric/conversions.rb @@ -134,7 +134,7 @@ module ActiveSupport::NumericWithFormat end # Ruby 2.4+ unifies Fixnum & Bignum into Integer. -if Integer == Fixnum +if 0.class == Integer Integer.prepend ActiveSupport::NumericWithFormat else Fixnum.prepend ActiveSupport::NumericWithFormat diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index 46b91806f6..921a3447d0 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -48,8 +48,8 @@ module ActiveSupport } # No need to map these on Ruby 2.4+ - TYPE_NAMES["Fixnum"] = "integer" unless Fixnum == Integer - TYPE_NAMES["Bignum"] = "integer" unless Bignum == Integer + TYPE_NAMES["Fixnum"] = "integer" unless 0.class == Integer + TYPE_NAMES["Bignum"] = "integer" unless 0.class == Integer end FORMATTING = { |