Fix issue with severed relationships notifications (#29668)

main
Claire 2024-03-20 18:02:09 +01:00 committed by GitHub
parent 954b470fbc
commit 98a2bb8be2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class AccountRelationshipSeveranceEvent < ApplicationRecord
belongs_to :account belongs_to :account
belongs_to :relationship_severance_event belongs_to :relationship_severance_event
delegate :severed_relationships, :type, :target_name, :purged, to: :relationship_severance_event, prefix: false delegate :severed_relationships, :type, :target_name, :purged?, to: :relationship_severance_event, prefix: false
before_create :set_relationships_count! before_create :set_relationships_count!

View File

@ -89,7 +89,7 @@ class Notification < ApplicationRecord
belongs_to :favourite, inverse_of: :notification belongs_to :favourite, inverse_of: :notification
belongs_to :poll, inverse_of: false belongs_to :poll, inverse_of: false
belongs_to :report, inverse_of: false belongs_to :report, inverse_of: false
belongs_to :relationship_severance_event, inverse_of: false belongs_to :account_relationship_severance_event, inverse_of: false
end end
validates :type, inclusion: { in: TYPES } validates :type, inclusion: { in: TYPES }

View File

@ -6,7 +6,7 @@ class REST::NotificationSerializer < ActiveModel::Serializer
belongs_to :from_account, key: :account, serializer: REST::AccountSerializer belongs_to :from_account, key: :account, serializer: REST::AccountSerializer
belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer
belongs_to :report, if: :report_type?, serializer: REST::ReportSerializer belongs_to :report, if: :report_type?, serializer: REST::ReportSerializer
belongs_to :relationship_severance_event, key: :event, if: :relationship_severance_event?, serializer: REST::AccountRelationshipSeveranceEventSerializer belongs_to :account_relationship_severance_event, key: :event, if: :relationship_severance_event?, serializer: REST::AccountRelationshipSeveranceEventSerializer
def id def id
object.id.to_s object.id.to_s