Skip to content

Commit dbb47d6

Browse files
committed
Revert "Merge pull request rails#46282 from jonathanhefner/active_model-forgetting_assignment-avoid-value_for_database"
This reverts commit 1f039d8, reversing changes made to be0b5c6. This revert is temporary while we debug some issues with our app. While we're pretty sure this is caused by code in our application and a compbination with `activerecord-typed_store`, the failure mode is easy to miss because it doesn't raise an exception. We will un-revert after a bit more investigation. We just want to be confident that the other cases where this could cause issues are fixed without being blocked from upgrading for the next month or so.
1 parent 866e053 commit dbb47d6

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)