about summary refs log tree commit diff
path: root/app/serializers/rest/status_edit_serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/rest/status_edit_serializer.rb')
-rw-r--r--app/serializers/rest/status_edit_serializer.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/serializers/rest/status_edit_serializer.rb b/app/serializers/rest/status_edit_serializer.rb
index a1f9e824e..05ccd5e94 100644
--- a/app/serializers/rest/status_edit_serializer.rb
+++ b/app/serializers/rest/status_edit_serializer.rb
@@ -3,12 +3,18 @@
 class REST::StatusEditSerializer < ActiveModel::Serializer
   has_one :account, serializer: REST::AccountSerializer
 
-  attributes :content, :spoiler_text,
-             :media_attachments_changed, :created_at
+  attributes :content, :spoiler_text, :sensitive, :created_at
 
+  has_many :ordered_media_attachments, key: :media_attachments, serializer: REST::MediaAttachmentSerializer
   has_many :emojis, serializer: REST::CustomEmojiSerializer
 
+  attribute :poll, if: -> { object.poll_options.present? }
+
   def content
     Formatter.instance.format(object)
   end
+
+  def poll
+    { options: object.poll_options.map { |title| { title: title } } }
+  end
 end