diff options
-rw-r--r-- | app/serializers/rest/status_serializer.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index 8578775c4..081b42979 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -31,7 +31,7 @@ class REST::StatusSerializer < ActiveModel::Serializer has_many :media_attachments, serializer: REST::MediaAttachmentSerializer has_many :ordered_mentions, key: :mentions - has_many :tags + has_many :ordered_tags, key: :tags has_many :emojis, serializer: REST::CustomEmojiSerializer has_one :preview_card, key: :card, serializer: REST::PreviewCardSerializer @@ -165,6 +165,10 @@ class REST::StatusSerializer < ActiveModel::Serializer object.active_mentions.to_a.sort_by(&:id) end + def ordered_tags + object.tags.order('name') + end + class ApplicationSerializer < ActiveModel::Serializer attributes :name, :website end |