Add notifications of severed relationships (#27511)
This commit is contained in:
		@@ -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
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user