Merge commit 'b922ad7a1b4bc8d968d0df2c7f307d4fec53435d' into glitch-soc/merge-upstream

Conflicts:
- `package.json`:
  Upstream changed various script definitions in lines surrounding the one for
  `i18n:extract`, which had glitch-soc-specific changes.
  Updated the scripts as upstream did, while keeping our changes to
  `i18n:extract`.
This commit is contained in:
Claire
2023-06-10 14:38:04 +02:00
37 changed files with 691 additions and 141 deletions

View File

@ -1,9 +1,38 @@
# frozen_string_literal: true
class REST::TranslationSerializer < ActiveModel::Serializer
attributes :content, :detected_source_language, :provider
attributes :detected_source_language, :language, :provider, :spoiler_text, :content
def content
object.text
class PollSerializer < ActiveModel::Serializer
attribute :id
has_many :options
def id
object.status.preloadable_poll.id.to_s
end
def options
object.poll_options
end
class OptionSerializer < ActiveModel::Serializer
attributes :title
end
end
has_one :poll, serializer: PollSerializer
class MediaAttachmentSerializer < ActiveModel::Serializer
attributes :id, :description
def id
object.id.to_s
end
end
has_many :media_attachments, serializer: MediaAttachmentSerializer
def poll
object if object.status.preloadable_poll
end
end