diff options
author | Faye Duxovni <duxovni@duxovni.org> | 2019-10-24 16:51:41 -0400 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-10-24 22:51:41 +0200 |
commit | 48f75b86aed816ef5afaaae64416dbeaa14e4fda (patch) | |
tree | 371840035b251cc15daf7ba1a494c2ccddda8ff5 /app/lib | |
parent | a6269b2f83e3eed1a8ab545f5756cd7b582075f5 (diff) |
Add setting for whether to crop images in unexpanded toots (#12126)
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 3568a3e11..fa8255faa 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -37,6 +37,7 @@ class UserSettingsDecorator 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') + user.settings['crop_images'] = crop_images_preference if change?('setting_crop_images') end def merged_notification_emails @@ -127,6 +128,10 @@ class UserSettingsDecorator boolean_cast_setting 'setting_trends' end + def crop_images_preference + boolean_cast_setting 'setting_crop_images' + end + def boolean_cast_setting(key) ActiveModel::Type::Boolean.new.cast(settings[key]) end |