2016-02-16 22:46:19 -06:00
|
|
|
class UserOptionSerializer < ApplicationSerializer
|
|
|
|
attributes :user_id,
|
|
|
|
:email_always,
|
|
|
|
: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,
|
|
|
|
:email_private_messages,
|
|
|
|
:email_direct,
|
|
|
|
:external_links_in_new_tab,
|
|
|
|
:dynamic_favicon,
|
|
|
|
:enable_quoting,
|
|
|
|
:disable_jump_reply,
|
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,
|
2017-11-09 13:45:19 -06:00
|
|
|
:homepage_id,
|
2018-10-10 12:00:08 -05:00
|
|
|
:hide_profile_and_presence
|
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
|