David Taylor 7826acc4a7
DEV: Replace site_setting_saved DiscourseEvent with site_setting_changed (#7401)
* DEV: Replace site_setting_saved DiscourseEvent with site_setting_changed

site_setting_saved is confusing for a few reasons:
- It is attached to the after_save of the ActiveRecord model. This is confusing because it only works 'properly' with the db_provider
- It passes the activerecord model as a parameter, which is confusing because you get access to the 'database' version of the setting, rather than the ruby setting. For example, booleans appear as 'y' or 'n' strings.
- When the event is called, the local process cache has not yet been updated. So if you call SiteSetting.setting_name inside the event handler, you will receive the old site setting value

I have deprecated that event, and added a new site_setting_changed event. It passes three parameters:
- Setting name (symbol)
- Old value (in ruby format)
- New value (in ruby format)

It is triggered after the setting has been persisted, and the local process cache has been updated.

This commit also includes a test case which describes the confusing behavior. This can be removed once site_setting_saved is removed.
2019-04-18 16:48:01 +01:00
..
2019-04-02 15:49:23 +01:00
2019-03-13 17:39:07 +08:00
2019-02-22 16:29:27 +01:00
2017-07-28 10:20:09 +09:00
2017-07-28 10:20:09 +09:00
2018-06-07 13:28:18 +08:00
2017-07-28 10:20:09 +09:00
2018-12-04 10:48:16 +01:00
2018-02-26 10:25:58 +11:00
2018-04-25 08:44:07 +10:00
2019-03-28 22:31:58 +00:00
2018-06-07 13:28:18 +08:00
2017-07-03 15:26:57 -04:00
2018-04-18 11:32:32 +05:30
2018-06-07 13:28:18 +08:00
2017-07-28 10:20:09 +09:00
2018-08-10 11:34:01 +10:00
2019-04-08 12:28:34 +08:00
2017-07-28 10:20:09 +09:00