method
init_attributes
v8.0.0 -
Show latest stable
- Class:
ActiveModel::Dirty
init_attributes(other)public
No documentation available.
# File activemodel/lib/active_model/dirty.rb, line 253
def init_attributes(other) # :nodoc:
attrs = super
if other.persisted? && self.class.respond_to?(:_default_attributes)
self.class._default_attributes.map do |attr|
attr.with_value_from_user(attrs.fetch_value(attr.name))
end
else
attrs
end
end