Merge remote-tracking branch 'parent/main' into upstream-20230209
This commit is contained in:
commit
05e52a09a8
188 changed files with 2810 additions and 1295 deletions
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
||||
attributes :id, :domain, :created_at, :severity,
|
||||
attributes :id, :domain, :digest, :created_at, :severity,
|
||||
:reject_media, :reject_favourite, :reject_reply, :reject_reports,
|
||||
:reject_reply_exclude_followers, :reject_send_sensitive, :block_trends,
|
||||
:reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription,
|
||||
|
@ -10,4 +10,8 @@ class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
|||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def digest
|
||||
object.domain_digest
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,20 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::SuggestionSerializer < ActiveModel::Serializer
|
||||
attributes :source
|
||||
attributes :source, :sources
|
||||
|
||||
has_one :account, serializer: REST::AccountSerializer
|
||||
|
||||
LEGACY_SOURCE_TYPE_MAP = {
|
||||
featured: 'staff',
|
||||
most_followed: 'global',
|
||||
most_interactions: 'global',
|
||||
# NOTE: Those are not completely accurate, but those are personalized interactions
|
||||
similar_to_recently_followed: 'past_interactions',
|
||||
friends_of_friends: 'past_interactions',
|
||||
}.freeze
|
||||
|
||||
def source
|
||||
LEGACY_SOURCE_TYPE_MAP[object.sources.first]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue