Serialize mentions in the order they are added (#6836)
Up until now, the order seemed to be in the *opposite* order, which caused the WebUI to populate mentions in reversed order when replying to toots local to one's instance.
This commit is contained in:
@ -15,7 +15,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
belongs_to :account, serializer: REST::AccountSerializer
|
||||
|
||||
has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
|
||||
has_many :mentions
|
||||
has_many :ordered_mentions, key: :mentions
|
||||
has_many :tags
|
||||
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
||||
|
||||
@ -86,6 +86,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
%w(public unlisted).include?(object.visibility)
|
||||
end
|
||||
|
||||
def ordered_mentions
|
||||
object.mentions.order(:id)
|
||||
end
|
||||
|
||||
class ApplicationSerializer < ActiveModel::Serializer
|
||||
attributes :name, :website
|
||||
end
|
||||
|
Reference in New Issue
Block a user