mirror of
https://github.com/discourse/discourse.git
synced 2024-11-21 16:38:15 -06:00
DEV: Do not include method definitions in serializer attributes
These accidental inclusions are mostly no-ops (because the method name is also included as an explicit symbol). The mistakes were made more obvious because syntax_tree adjusted the indentation of these methods
This commit is contained in:
parent
5a003715d3
commit
f05da14fb6
@ -17,7 +17,8 @@ class CurrentUserOptionSerializer < ApplicationSerializer
|
||||
:seen_popups,
|
||||
:should_be_redirected_to_top,
|
||||
:redirected_to_top,
|
||||
:treat_as_new_topic_start_date,
|
||||
:treat_as_new_topic_start_date
|
||||
|
||||
def likes_notifications_disabled
|
||||
object.likes_notifications_disabled?
|
||||
end
|
||||
|
@ -10,7 +10,8 @@ class TopicLinkSerializer < ApplicationSerializer
|
||||
:clicks,
|
||||
:user_id,
|
||||
:domain,
|
||||
:root_domain,
|
||||
:root_domain
|
||||
|
||||
def attachment
|
||||
Discourse.store.has_been_uploaded?(object.url)
|
||||
end
|
||||
|
@ -9,7 +9,8 @@ class TopicPostCountSerializer < BasicUserSerializer
|
||||
:flair_bg_color,
|
||||
:admin,
|
||||
:moderator,
|
||||
:trust_level,
|
||||
:trust_level
|
||||
|
||||
def id
|
||||
object[:user].id
|
||||
end
|
||||
|
@ -36,10 +36,10 @@ class UserOptionSerializer < ApplicationSerializer
|
||||
:skip_new_user_tips,
|
||||
:default_calendar,
|
||||
:oldest_search_log_date,
|
||||
:seen_popups,
|
||||
:seen_popups
|
||||
|
||||
def auto_track_topics_after_msecs
|
||||
object.auto_track_topics_after_msecs ||
|
||||
SiteSetting.default_other_auto_track_topics_after_msecs
|
||||
object.auto_track_topics_after_msecs || SiteSetting.default_other_auto_track_topics_after_msecs
|
||||
end
|
||||
|
||||
def notification_level_when_replying
|
||||
|
@ -67,9 +67,8 @@ class UserSerializer < UserCardSerializer
|
||||
:sidebar_list_destination,
|
||||
:display_sidebar_tags
|
||||
|
||||
untrusted_attributes :bio_raw,
|
||||
:bio_cooked,
|
||||
:profile_background_upload_url,
|
||||
untrusted_attributes :bio_raw, :bio_cooked, :profile_background_upload_url
|
||||
|
||||
###
|
||||
### ATTRIBUTES
|
||||
###
|
||||
|
Loading…
Reference in New Issue
Block a user