mirror of
https://github.com/ditkrg/schemable.git
synced 2026-01-22 22:26:41 +00:00
Adds default_value_for_enum_attributes method to Schemable::Definition
This commit is contained in:
parent
33a11e95a3
commit
5b32cb2b95
@ -265,6 +265,19 @@ module Schemable
|
|||||||
%i[]
|
%i[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the default value for the enum attributes.
|
||||||
|
#
|
||||||
|
# @example
|
||||||
|
# {
|
||||||
|
# status: 'pending',
|
||||||
|
# flag: 0
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# @return [Hash] The custom default values for the enum attributes.
|
||||||
|
def default_value_for_enum_attributes
|
||||||
|
{}
|
||||||
|
end
|
||||||
|
|
||||||
# Returns an instance of the model class that is already serialized into jsonapi format.
|
# Returns an instance of the model class that is already serialized into jsonapi format.
|
||||||
#
|
#
|
||||||
# @return [Hash] The serialized instance of the model class.
|
# @return [Hash] The serialized instance of the model class.
|
||||||
|
|||||||
@ -25,6 +25,7 @@ module Schemable
|
|||||||
def excluded_update_request_attributes: -> Array[Symbol]
|
def excluded_update_request_attributes: -> Array[Symbol]
|
||||||
def optional_create_request_attributes: -> Array[Symbol]
|
def optional_create_request_attributes: -> Array[Symbol]
|
||||||
def optional_update_request_attributes: -> Array[Symbol]
|
def optional_update_request_attributes: -> Array[Symbol]
|
||||||
|
def default_value_for_enum_attributes: -> Hash[Symbol, any]
|
||||||
def additional_create_request_attributes: -> Hash[Symbol, any]
|
def additional_create_request_attributes: -> Hash[Symbol, any]
|
||||||
def additional_update_request_attributes: -> Hash[Symbol, any]
|
def additional_update_request_attributes: -> Hash[Symbol, any]
|
||||||
def camelize_keys: (Hash[Symbol, any]) -> (Array[Hash[Symbol, any]] | Hash[Symbol, any])
|
def camelize_keys: (Hash[Symbol, any]) -> (Array[Hash[Symbol, any]] | Hash[Symbol, any])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user