Add: #98 警告の通知に投稿情報を追加 (#684)

This commit is contained in:
KMY(雪あすか) 2024-04-01 08:54:29 +09:00 committed by GitHub
parent e7aececf5e
commit 95a18edaac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 9 deletions

View file

@ -3,6 +3,8 @@
class REST::NotificationSerializer < ActiveModel::Serializer
attributes :id, :type, :created_at
has_many :statuses, serializer: REST::StatusSerializer, if: :warning_type?
belongs_to :from_account_web, 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
@ -42,4 +44,8 @@ class REST::NotificationSerializer < ActiveModel::Serializer
def relationship_severance_event?
object.type == :severed_relationships
end
def statuses
Status.where(id: object.account_warning.status_ids).to_a
end
end