Fix markdown property on edit status
This commit is contained in:
parent
25c3915728
commit
8db2f96c36
5 changed files with 10 additions and 2 deletions
|
@ -19,6 +19,7 @@ module StatusSnapshotConcern
|
||||||
status_id: id,
|
status_id: id,
|
||||||
text: text,
|
text: text,
|
||||||
spoiler_text: spoiler_text,
|
spoiler_text: spoiler_text,
|
||||||
|
markdown: markdown,
|
||||||
sensitive: sensitive,
|
sensitive: sensitive,
|
||||||
ordered_media_attachment_ids: ordered_media_attachment_ids&.dup || media_attachments.pluck(:id),
|
ordered_media_attachment_ids: ordered_media_attachment_ids&.dup || media_attachments.pluck(:id),
|
||||||
media_descriptions: ordered_media_attachments.map(&:description),
|
media_descriptions: ordered_media_attachments.map(&:description),
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
# media_descriptions :text is an Array
|
# media_descriptions :text is an Array
|
||||||
# poll_options :string is an Array
|
# poll_options :string is an Array
|
||||||
# sensitive :boolean
|
# sensitive :boolean
|
||||||
|
# markdown :boolean default(FALSE)
|
||||||
#
|
#
|
||||||
|
|
||||||
class StatusEdit < ApplicationRecord
|
class StatusEdit < ApplicationRecord
|
||||||
|
|
|
@ -5,7 +5,7 @@ class REST::StatusEditSerializer < ActiveModel::Serializer
|
||||||
|
|
||||||
has_one :account, serializer: REST::AccountSerializer
|
has_one :account, serializer: REST::AccountSerializer
|
||||||
|
|
||||||
attributes :content, :spoiler_text, :sensitive, :created_at
|
attributes :content, :spoiler_text, :markdown, :sensitive, :created_at
|
||||||
|
|
||||||
has_many :ordered_media_attachments, key: :media_attachments, serializer: REST::MediaAttachmentSerializer
|
has_many :ordered_media_attachments, key: :media_attachments, serializer: REST::MediaAttachmentSerializer
|
||||||
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddMarkdownToStatusEdits < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
add_column :status_edits, :markdown, :boolean, default: false
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2023_04_12_005311) do
|
ActiveRecord::Schema.define(version: 2023_04_12_073021) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -912,6 +912,7 @@ ActiveRecord::Schema.define(version: 2023_04_12_005311) do
|
||||||
t.text "media_descriptions", array: true
|
t.text "media_descriptions", array: true
|
||||||
t.string "poll_options", array: true
|
t.string "poll_options", array: true
|
||||||
t.boolean "sensitive"
|
t.boolean "sensitive"
|
||||||
|
t.boolean "markdown", default: false
|
||||||
t.index ["account_id"], name: "index_status_edits_on_account_id"
|
t.index ["account_id"], name: "index_status_edits_on_account_id"
|
||||||
t.index ["status_id"], name: "index_status_edits_on_status_id"
|
t.index ["status_id"], name: "index_status_edits_on_status_id"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue