Skip to content

Commit 586436d

Browse files
authored
Merge pull request rails#46444 from eileencodes/revert-forgetting-assignment-changes
Revert "Merge pull request rails#46282 from jonathanhefner/active_model-forgetting_assignment-avoid-value_for_database
2 parents 866e053 + dbb47d6 commit 586436d

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

activemodel/lib/active_model/attribute.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,6 @@ def type_cast(value)
175175
type.deserialize(value)
176176
end
177177

178-
def forgetting_assignment
179-
# If this attribute was not persisted (with a `value_for_database`
180-
# that might differ from `value_before_type_cast`) and `value` has not
181-
# changed in place, we can simply dup this attribute to avoid
182-
# deserialize / cast / serialize calls from computing the new
183-
# attribute's `value_before_type_cast`.
184-
if !defined?(@value_for_database) && !changed_in_place?
185-
dup
186-
else
187-
super
188-
end
189-
end
190-
191178
private
192179
def _original_value_for_database
193180
value_before_type_cast

0 commit comments

Comments
 (0)