2
0

Add notifications of severed relationships (#27511)

This commit is contained in:
Claire
2024-03-20 16:37:21 +01:00
committed by GitHub
parent 8a1423a474
commit 44bf7b8128
39 changed files with 781 additions and 54 deletions

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
class REST::AccountRelationshipSeveranceEventSerializer < ActiveModel::Serializer
attributes :id, :type, :purged, :target_name, :created_at
def id
object.id.to_s
end
end

View File

@@ -6,6 +6,7 @@ class REST::NotificationSerializer < ActiveModel::Serializer
belongs_to :from_account, key: :account, serializer: REST::AccountSerializer
belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer
belongs_to :report, if: :report_type?, serializer: REST::ReportSerializer
belongs_to :relationship_severance_event, key: :event, if: :relationship_severance_event?, serializer: REST::AccountRelationshipSeveranceEventSerializer
def id
object.id.to_s
@@ -18,4 +19,8 @@ class REST::NotificationSerializer < ActiveModel::Serializer
def report_type?
object.type == :'admin.report'
end
def relationship_severance_event?
object.type == :severed_relationships
end
end