winter
winter copied to clipboard
Allow mutators for Settings models and improve API
Fixes #1047. Replaces #1071.
- Use
getAttributemethod in themodel.setAttributelistener within theSettingsModelbehavior to retrieve the (possibly) mutated value before saving into settings array. - Ensure that default values populated by
initSettingsDatamethod in a Settings model are populated into settings array if not yet persisted in the DB, so that they are accessible via model properties. - Allow values to be retrieved as model properties at any time.
@goldmont would you be willing to test this PR as an alternate fix for #1047? I've added a test case for your scenario, but happy to hear if it works out in the wild.