winter icon indicating copy to clipboard operation
winter copied to clipboard

Allow mutators for Settings models and improve API

Open bennothommo opened this issue 1 year ago • 1 comments

Fixes #1047. Replaces #1071.

  • Use getAttribute method in the model.setAttribute listener within the SettingsModel behavior to retrieve the (possibly) mutated value before saving into settings array.
  • Ensure that default values populated by initSettingsData method 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.

bennothommo avatar Mar 05 '24 02:03 bennothommo

@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.

bennothommo avatar Mar 05 '24 02:03 bennothommo