|
|
72d67b |
From b552b5edaffe5dae183ece4d8475a0e7005da6c7 Mon Sep 17 00:00:00 2001
|
|
|
72d67b |
From: Matthew Draper <matthew@trebex.net>
|
|
|
72d67b |
Date: Sat, 8 Oct 2016 10:50:36 +1030
|
|
|
72d67b |
Subject: [PATCH] Merge pull request #26732 from matthewd/fixnum-warning
|
|
|
72d67b |
|
|
|
72d67b |
Fixnum and Bignum are deprecated in Ruby trunk
|
|
|
72d67b |
---
|
|
|
72d67b |
activesupport/lib/active_support/core_ext/numeric/conversions.rb | 2 +-
|
|
|
72d67b |
activesupport/lib/active_support/xml_mini.rb | 4 ++--
|
|
|
72d67b |
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
72d67b |
|
|
|
72d67b |
diff --git a/activesupport/lib/active_support/core_ext/numeric/conversions.rb b/activesupport/lib/active_support/core_ext/numeric/conversions.rb
|
|
|
72d67b |
index 6586a35..193f6b2 100644
|
|
|
72d67b |
--- a/activesupport/lib/active_support/core_ext/numeric/conversions.rb
|
|
|
72d67b |
+++ b/activesupport/lib/active_support/core_ext/numeric/conversions.rb
|
|
|
72d67b |
@@ -135,7 +135,7 @@ def to_formatted_s(*args)
|
|
|
72d67b |
end
|
|
|
72d67b |
|
|
|
72d67b |
# Ruby 2.4+ unifies Fixnum & Bignum into Integer.
|
|
|
72d67b |
-if Integer == Fixnum
|
|
|
72d67b |
+if 0.class == Integer
|
|
|
72d67b |
Integer.prepend ActiveSupport::NumericWithFormat
|
|
|
72d67b |
else
|
|
|
72d67b |
Fixnum.prepend ActiveSupport::NumericWithFormat
|
|
|
72d67b |
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb
|
|
|
72d67b |
index 99fc265..1812de0 100644
|
|
|
72d67b |
--- a/activesupport/lib/active_support/xml_mini.rb
|
|
|
72d67b |
+++ b/activesupport/lib/active_support/xml_mini.rb
|
|
|
72d67b |
@@ -48,8 +48,8 @@ def content_type
|
|
|
72d67b |
}
|
|
|
72d67b |
|
|
|
72d67b |
# No need to map these on Ruby 2.4+
|
|
|
72d67b |
- TYPE_NAMES["Fixnum"] = "integer" unless Fixnum == Integer
|
|
|
72d67b |
- TYPE_NAMES["Bignum"] = "integer" unless Bignum == Integer
|
|
|
72d67b |
+ TYPE_NAMES["Fixnum"] = "integer" unless 0.class == Integer
|
|
|
72d67b |
+ TYPE_NAMES["Bignum"] = "integer" unless 0.class == Integer
|
|
|
72d67b |
end
|
|
|
72d67b |
|
|
|
72d67b |
FORMATTING = {
|