Open
Description
Context
We want to give the ability to developers to set certain settings to a certain value globally.
For example, set all the belongs_to
fields to have the searchable
value to true
.
Explorations
config.default_settings = {
fields: {
belongs_to: {
searchable: false,
polymorphic_as: false,
relation_method: false,
}
},
"fields.belongs_to.searchable": false,
"fields.belongs_to.polymorphic_as": false,
"fields.belongs_to.relation_method": false,
}
@searchable = default_attribute("fields.belongs_to.searchable", args[:searchable] == true)
@polymorphic_as = default_attribute("fields.belongs_to.polymorphic_as", args[:can_create].nil? ? true : args[:can_create])
def default_attribute(key, default)
if value_exists?(key)
value(key)
else
default
end
end
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog