diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-08-06 17:57:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-06 17:57:52 +0200 |
commit | 9072fe5ab6464cc9c7a871d388464c7afcf41cd0 (patch) | |
tree | b3b379a4eeebc56825a6374f854e73b35678da6c /app/lib | |
parent | 82d2069c75071138f582503c39b0996cc4cdff11 (diff) |
Add trends UI with admin and user settings (#11502)
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/user_settings_decorator.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index 9ae9986c2..3568a3e11 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -36,6 +36,7 @@ class UserSettingsDecorator user.settings['advanced_layout'] = advanced_layout_preference if change?('setting_advanced_layout') user.settings['use_blurhash'] = use_blurhash_preference if change?('setting_use_blurhash') user.settings['use_pending_items'] = use_pending_items_preference if change?('setting_use_pending_items') + user.settings['trends'] = trends_preference if change?('setting_trends') end def merged_notification_emails @@ -122,6 +123,10 @@ class UserSettingsDecorator boolean_cast_setting 'setting_use_pending_items' end + def trends_preference + boolean_cast_setting 'setting_trends' + end + def boolean_cast_setting(key) ActiveModel::Type::Boolean.new.cast(settings[key]) end |