module ActiveModel::AttributeRegistration::ClassMethods

def attribute(name, type = nil, default: (no_default = true), **options)

:nodoc:
def attribute(name, type = nil, default: (no_default = true), **options)
  name = resolve_attribute_name(name)
  type = resolve_type_name(type, **options) if type.is_a?(Symbol)
  type = hook_attribute_type(name, type) if type
  pending_attribute_modifications << PendingType.new(name, type) if type || no_default
  pending_attribute_modifications << PendingDefault.new(name, default) unless no_default
  reset_default_attributes
end