Hide real count on api level
This commit is contained in:
parent
9818f6a0e1
commit
a4de9fcfdb
2 changed files with 17 additions and 4 deletions
|
@ -123,10 +123,6 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||
object.suspended? ? [] : object.fields
|
||||
end
|
||||
|
||||
def other_settings
|
||||
object.suspended? || object.settings.nil? ? {} : object.settings
|
||||
end
|
||||
|
||||
def suspended
|
||||
object.suspended?
|
||||
end
|
||||
|
@ -160,4 +156,20 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||
def moved_and_not_nested?
|
||||
object.moved?
|
||||
end
|
||||
|
||||
def statuses_count
|
||||
object.settings.present? && object.settings['hide_statuses_count'] ? 0 : object.statuses_count
|
||||
end
|
||||
|
||||
def followers_count
|
||||
object.settings.present? && object.settings['hide_followers_count'] ? 0 : object.followers_count
|
||||
end
|
||||
|
||||
def following_count
|
||||
object.settings.present? && object.settings['hide_followers_count'] ? 0 : object.following_count
|
||||
end
|
||||
|
||||
def other_settings
|
||||
object.suspended? || object.settings.nil? ? {} : object.settings
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue