th: status: prevent recursion when serializing

lolsob-rspec
Ariadne Conill 2022-12-25 04:02:08 +00:00
parent 104cf929a5
commit 9107a290c1
1 changed files with 10 additions and 1 deletions

View File

@ -23,7 +23,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
belongs_to :reblog, serializer: REST::StatusSerializer
belongs_to :application, if: :show_application?
belongs_to :account, serializer: REST::AccountSerializer
belongs_to :quote, serializer: REST::StatusSerializer
has_many :ordered_media_attachments, key: :media_attachments, serializer: REST::MediaAttachmentSerializer
has_many :ordered_mentions, key: :mentions
@ -185,3 +184,13 @@ class REST::StatusSerializer < ActiveModel::Serializer
end
end
end
class REST::QuoteStatusSerializer < REST::StatusSerializer
attribute :quote do
nil
end
end
class REST::StatusSerializer < ActiveModel::Serializer
belongs_to :quote, serializer: REST::QuoteStatusSerializer
end