diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-22 11:31:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 11:31:17 +0100 |
commit | 9fe1619db94e3267b263633ecd4d05a840064215 (patch) | |
tree | 9774661f91a76ddd335f20460995fbfd70ae5ad8 | |
parent | da70aca28eaa68f21c450c8f7b6ecb6168d29941 (diff) |
Do not re-query mentions from serializers (#6858)
Fix performance regression from #6836
-rw-r--r-- | app/serializers/activitypub/note_serializer.rb | 2 | ||||
-rw-r--r-- | app/serializers/rest/status_serializer.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index abaf29047ad..ddafb540d0a 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -57,7 +57,7 @@ class ActivityPub::NoteSerializer < ActiveModel::Serializer end def virtual_tags - object.mentions.order(:id) + object.tags + object.emojis + object.mentions.to_a.sort_by(&:id) + object.tags + object.emojis end def atom_uri diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index 67da92cd5ce..fe3dc9bfcfb 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -87,7 +87,7 @@ class REST::StatusSerializer < ActiveModel::Serializer end def ordered_mentions - object.mentions.order(:id) + object.mentions.to_a.sort_by(&:id) end class ApplicationSerializer < ActiveModel::Serializer |