Skip to content

Commit 2109326

Browse files
committed
Also undefine with on Symbol
1 parent a4d7ed1 commit 2109326

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ def with(**attributes)
3939

4040
# #with isn't usable on immediates, so we might as well undefine the
4141
# method in common immediate classes to avoid potential confusion.
42-
[NilClass, TrueClass, FalseClass, Integer, Float].each do |klass|
42+
[NilClass, TrueClass, FalseClass, Integer, Float, Symbol].each do |klass|
4343
klass.undef_method(:with)
4444
end

activesupport/test/core_ext/object/with_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,6 @@ def initialize
9494
assert_not_respond_to false, :with
9595
assert_not_respond_to 1, :with
9696
assert_not_respond_to 1.0, :with
97+
assert_not_respond_to :sym, :with
9798
end
9899
end

0 commit comments

Comments
 (0)