class ActiveModel::LazyAttributeSet
def default_attribute(
Experimental RBS support (using type sampling data from the type_fusion
project).
type ActiveModel__LazyAttributeSet_default_attribute_value = nil | Integer | String | false | Time def default_attribute: (String name, ?bool value_present, ?ActiveModel__LazyAttributeSet_default_attribute_value value) -> (ActiveModel::Attribute::FromDatabase | ActiveModel::Attribute::WithCastValue)
This signature was generated using 16 samples from 1 application.
def default_attribute( name, value_present = true, value = values.fetch(name) { value_present = false } ) type = additional_types.fetch(name, types[name]) if value_present @attributes[name] = Attribute.from_database(name, value, type, @casted_values[name]) elsif types.key?(name) if attr = default_attributes[name] @attributes[name] = attr.dup else @attributes[name] = Attribute.uninitialized(name, type) end else Attribute.null(name) end end