mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:11:08 -06:00
7826acc4a7
* 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. |
||
---|---|---|
.. | ||
000-mini_sql.rb | ||
000-post_migration.rb | ||
001-redis.rb | ||
002-freedom_patches.rb | ||
003-sql_builder.rb | ||
004-message_bus.rb | ||
004-rails_multisite.rb | ||
005-site_settings.rb | ||
006-ensure_login_hint.rb | ||
006-mini_profiler.rb | ||
008-rack-cors.rb | ||
009-omniauth.rb | ||
010-discourse_iife.rb | ||
011-rack-protection.rb | ||
012-web_hook_events.rb | ||
013-excon_defaults.rb | ||
014-track-setting-changes.rb | ||
050-force_https.rb | ||
099-anon-cache.rb | ||
099-defer.rb | ||
099-drain_pool.rb | ||
100-i18n.rb | ||
100-logster.rb | ||
100-oj.rb | ||
100-onebox_options.rb | ||
100-push-notifications.rb | ||
100-quiet_logger.rb | ||
100-secret_token.rb | ||
100-session_store.rb | ||
100-sidekiq.rb | ||
100-silence_logger.rb | ||
100-strong_parameters.rb | ||
100-verify_config.rb | ||
100-watch_for_restart.rb | ||
100-wrap_parameters.rb | ||
101-lograge.rb | ||
200-message_bus_request_tracker.rb |