Skip to content

Commit df99121

Browse files
authored
Merge pull request rails#53510 from byroot/revert-dirty-persisted
Revert "ActiveModel::Dirty: only reset original values for persisted records"
2 parents a8a72f5 + 7d69f24 commit df99121

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activemodel/lib/active_model/dirty.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def initialize_dup(other) # :nodoc:
252252

253253
def init_attributes(other) # :nodoc:
254254
attrs = super
255-
if other.persisted? && self.class.respond_to?(:_default_attributes)
255+
if self.class.respond_to?(:_default_attributes)
256256
self.class._default_attributes.map do |attr|
257257
attr.with_value_from_user(attrs.fetch_value(attr.name))
258258
end

0 commit comments

Comments
 (0)