We wish to support the action 'update_attribute' in the /update_model controller. This action allows us to change properties of an existing attribute, excepting its name and type.
Following #164 we can instantiate this as Magma::UpdateAttributeAction < Magma::Action. The expected params would be at least model_name, attribute_name. The remaining params might come from Magma::Attribute::EDITABLE_OPTIONS.
The validation should presumably determine that the values for each EDITABLE_OPTION are well-formed - I'm not sure what sort of existing facility we have for this kind of validation, so it might need to be created.
If the inputs are well-formed, the method #action! might use Magma::Attribute.update_option to set the new value(s).
We wish to support the action 'update_attribute' in the /update_model controller. This action allows us to change properties of an existing attribute, excepting its name and type.
Following #164 we can instantiate this as
Magma::UpdateAttributeAction < Magma::Action
. The expected params would be at leastmodel_name, attribute_name
. The remaining params might come fromMagma::Attribute::EDITABLE_OPTIONS
.The validation should presumably determine that the values for each EDITABLE_OPTION are well-formed - I'm not sure what sort of existing facility we have for this kind of validation, so it might need to be created.
If the inputs are well-formed, the method
#action!
might useMagma::Attribute.update_option
to set the new value(s).