diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-10-11 10:43:47 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-10-11 10:43:47 -0500 |
commit | ca8e77f3dc06bc758c606d316d68ba6a2c1b4a20 (patch) | |
tree | 674fd8518e8ab9c3d8892fd4091543526f6688bb /app/lib | |
parent | 267bf798fe48ceff8f11e893af4356aa170ae6e1 (diff) |
Add post history limiting options
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/user_settings_decorator.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index 8bed47835..ddce9764a 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -64,6 +64,8 @@ class UserSettingsDecorator user.settings['unpublish_on_delete'] = unpublish_on_delete_preference if change?('setting_unpublish_on_delete') user.settings['rss_disabled'] = rss_disabled_preference if change?('setting_rss_disabled') user.settings['no_boosts_home'] = no_boosts_home_preference if change?('setting_no_boosts_home') + user.settings['max_history_public'] = max_history_public_preference if change?('setting_max_history_public') + user.settings['max_history_private'] = max_history_private_preference if change?('setting_max_history_private') end def merged_notification_emails @@ -246,6 +248,14 @@ class UserSettingsDecorator boolean_cast_setting 'setting_no_boosts_home' end + def max_history_public_preference + settings['setting_max_history_public'].to_i + end + + def max_history_private_preference + settings['setting_max_history_private'].to_i + end + def boolean_cast_setting(key) ActiveModel::Type::Boolean.new.cast(settings[key]) end |