Skip to content

Commit 399af7f

Browse files
authored
Revert "ActiveModel::Attribute: elide dup for immutable types"
1 parent 6e284f3 commit 399af7f

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

activemodel/lib/active_model/attribute.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ def with_type(type)
9696
end
9797
end
9898

99-
def deep_dup # :nodoc:
100-
if @type.mutable?
101-
dup
102-
else
103-
self # If the underlying type is immutable we can get away with not duping
104-
end
105-
end
106-
10799
def type_cast(*)
108100
raise NotImplementedError
109101
end

activemodel/lib/active_model/attribute/user_provided_default.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ def with_type(type)
2626
self.class.new(name, user_provided_value, type, original_attribute)
2727
end
2828

29-
# Can't elide dup when a default is provided.
30-
# See Attribute#deep_dup
31-
alias_method :deep_dup, :dup
32-
3329
def marshal_dump
3430
result = [
3531
name,

activemodel/lib/active_model/type/string.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ def to_immutable_string
2929
)
3030
end
3131

32-
def mutable? # :nodoc:
33-
true
34-
end
35-
3632
private
3733
def cast_value(value)
3834
case value

0 commit comments

Comments
 (0)