2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-02-16 22:46:19 -06:00
|
|
|
class UserOptionSerializer < ApplicationSerializer
|
|
|
|
attributes :user_id,
|
|
|
|
:mailing_list_mode,
|
2016-05-21 08:17:54 -05:00
|
|
|
:mailing_list_mode_frequency,
|
2016-02-16 22:46:19 -06:00
|
|
|
:email_digests,
|
2019-03-15 09:55:11 -05:00
|
|
|
:email_level,
|
|
|
|
:email_messages_level,
|
2016-02-16 22:46:19 -06:00
|
|
|
:external_links_in_new_tab,
|
2020-08-06 08:45:37 -05:00
|
|
|
:dark_scheme_id,
|
2016-02-16 22:46:19 -06:00
|
|
|
:dynamic_favicon,
|
|
|
|
:enable_quoting,
|
2019-05-31 00:43:17 -05:00
|
|
|
:enable_defer,
|
2016-03-02 14:26:27 -06:00
|
|
|
:digest_after_minutes,
|
2016-02-16 22:46:19 -06:00
|
|
|
:automatically_unpin_topics,
|
2016-02-17 23:57:22 -06:00
|
|
|
:auto_track_topics_after_msecs,
|
2016-09-30 11:36:43 -05:00
|
|
|
:notification_level_when_replying,
|
2016-02-18 20:56:52 -06:00
|
|
|
:new_topic_duration_minutes,
|
2016-02-25 07:05:40 -06:00
|
|
|
:email_previous_replies,
|
2016-03-02 06:16:52 -06:00
|
|
|
:email_in_reply_to,
|
2016-03-17 16:35:23 -05:00
|
|
|
:like_notification_frequency,
|
2017-05-12 11:41:26 -05:00
|
|
|
:include_tl0_in_digests,
|
2018-07-11 23:18:21 -05:00
|
|
|
:theme_ids,
|
2017-10-06 02:56:58 -05:00
|
|
|
:theme_key_seq,
|
|
|
|
:allow_private_messages,
|
2020-07-20 16:23:49 -05:00
|
|
|
:enable_allowed_pm_users,
|
2017-11-09 13:45:19 -06:00
|
|
|
:homepage_id,
|
2019-01-14 07:21:46 -06:00
|
|
|
:hide_profile_and_presence,
|
2019-01-28 05:19:50 -06:00
|
|
|
:text_size,
|
2019-04-11 18:02:18 -05:00
|
|
|
:text_size_seq,
|
2019-11-24 18:49:27 -06:00
|
|
|
:title_count_mode,
|
|
|
|
:timezone
|
2016-02-16 22:46:19 -06:00
|
|
|
|
2016-02-17 23:57:22 -06:00
|
|
|
def auto_track_topics_after_msecs
|
|
|
|
object.auto_track_topics_after_msecs || SiteSetting.default_other_auto_track_topics_after_msecs
|
|
|
|
end
|
|
|
|
|
2016-09-30 11:36:43 -05:00
|
|
|
def notification_level_when_replying
|
|
|
|
object.notification_level_when_replying || SiteSetting.default_other_notification_level_when_replying
|
|
|
|
end
|
|
|
|
|
2016-02-17 23:57:22 -06:00
|
|
|
def new_topic_duration_minutes
|
|
|
|
object.new_topic_duration_minutes || SiteSetting.default_other_new_topic_duration_minutes
|
|
|
|
end
|
|
|
|
|
2018-07-11 23:18:21 -05:00
|
|
|
def theme_ids
|
|
|
|
object.theme_ids.presence || [SiteSetting.default_theme_id]
|
2017-05-12 11:41:26 -05:00
|
|
|
end
|
|
|
|
|
2016-02-16 22:46:19 -06:00
|
|
|
end
|