From ca8e77f3dc06bc758c606d316d68ba6a2c1b4a20 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 11 Oct 2020 10:43:47 -0500 Subject: Add post history limiting options --- app/lib/user_settings_decorator.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/lib') 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 -- cgit