Skip to content

Commit 8e251a0

Browse files
committed
Use Module#include rather than prepend since we don't need prepend semantics here and include leads to faster method lookups.
1 parent 271dab6 commit 8e251a0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

activesupport/lib/active_support/core_ext/numeric/conversions.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ def to_fs(format = nil, options = nil)
140140
end
141141
end
142142

143-
Integer.prepend ActiveSupport::NumericWithFormat
144-
Float.prepend ActiveSupport::NumericWithFormat
145-
BigDecimal.prepend ActiveSupport::NumericWithFormat
143+
Integer.include ActiveSupport::NumericWithFormat
144+
Float.include ActiveSupport::NumericWithFormat
145+
BigDecimal.include ActiveSupport::NumericWithFormat

activesupport/lib/active_support/core_ext/object/json.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def to_json(options = nil)
4646
end
4747

4848
[Enumerable, Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass].reverse_each do |klass|
49-
klass.prepend(ActiveSupport::ToJsonWithActiveSupportEncoder)
49+
klass.include(ActiveSupport::ToJsonWithActiveSupportEncoder)
5050
end
5151

5252
class Module

0 commit comments

Comments
 (0)