method
init_with
v6.1.3.1 -
Show latest stable
- Class:
ActiveModel::Errors
init_with(coder)public
No documentation available.
# File activemodel/lib/active_model/errors.rb, line 552
def init_with(coder) # :nodoc:
data = coder.map
data.each { |k, v|
next if LEGACY_ATTRIBUTES.include?(k.to_sym)
instance_variable_set(:"@#{k}", v)
}
@errors ||= []
# Legacy support Rails 5.x details hash
add_from_legacy_details_hash(data["details"]) if data.key?("details")
end