aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/numeric/conversions.rb2
-rw-r--r--activesupport/lib/active_support/xml_mini.rb4
-rw-r--r--activesupport/test/core_ext/array/grouping_test.rb4
3 files changed, 5 insertions, 5 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 = {
diff --git a/activesupport/test/core_ext/array/grouping_test.rb b/activesupport/test/core_ext/array/grouping_test.rb
index 86c9bae131..b06f87c008 100644
--- a/activesupport/test/core_ext/array/grouping_test.rb
+++ b/activesupport/test/core_ext/array/grouping_test.rb
@@ -4,11 +4,11 @@ require "active_support/core_ext/array"
class GroupingTest < ActiveSupport::TestCase
def setup
# In Ruby < 2.4, test we avoid Integer#/ (redefined by mathn)
- Fixnum.send :private, :/ unless Fixnum == Integer
+ Fixnum.send :private, :/ unless 0.class == Integer
end
def teardown
- Fixnum.send :public, :/ unless Fixnum == Integer
+ Fixnum.send :public, :/ unless 0.class == Integer
end
def test_in_groups_of_with_perfect_fit