Adds default_value_for_enum_attributes method to Schemable::Definition

This commit is contained in:
Muhammad Nawzad
2024-01-29 10:53:20 +03:00
parent 33a11e95a3
commit 5b32cb2b95
2 changed files with 14 additions and 0 deletions

View File

@@ -265,6 +265,19 @@ module Schemable
%i[]
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.
#
# @return [Hash] The serialized instance of the model class.