You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.6 KiB
40 lines
1.6 KiB
From b552b5edaffe5dae183ece4d8475a0e7005da6c7 Mon Sep 17 00:00:00 2001
|
|
From: Matthew Draper <matthew@trebex.net>
|
|
Date: Sat, 8 Oct 2016 10:50:36 +1030
|
|
Subject: [PATCH] Merge pull request #26732 from matthewd/fixnum-warning
|
|
|
|
Fixnum and Bignum are deprecated in Ruby trunk
|
|
---
|
|
activesupport/lib/active_support/core_ext/numeric/conversions.rb | 2 +-
|
|
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 6586a35..193f6b2 100644
|
|
--- a/activesupport/lib/active_support/core_ext/numeric/conversions.rb
|
|
+++ b/activesupport/lib/active_support/core_ext/numeric/conversions.rb
|
|
@@ -135,7 +135,7 @@ def to_formatted_s(*args)
|
|
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 99fc265..1812de0 100644
|
|
--- a/activesupport/lib/active_support/xml_mini.rb
|
|
+++ b/activesupport/lib/active_support/xml_mini.rb
|
|
@@ -48,8 +48,8 @@ def content_type
|
|
}
|
|
|
|
# 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 = {
|