diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-11-28 04:08:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-28 04:08:00 +0100 |
commit | 07da35c17c4ff8e0fc7b90aba0b619dae119a633 (patch) | |
tree | 5263746a1d2a550a44f1861731cfd5547a676742 /app/serializers/rest | |
parent | d9793b2367ec6171256e46dde9657f664c2b4268 (diff) |
Fix n+1 query for bookmarks on statuses (#12494)
Diffstat (limited to 'app/serializers/rest')
-rw-r--r-- | app/serializers/rest/status_serializer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index 08bc4d82a..1ed8948da 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -95,8 +95,8 @@ class REST::StatusSerializer < ActiveModel::Serializer end def bookmarked - if instance_options && instance_options[:bookmarks] - instance_options[:bookmarks].bookmarks_map[object.id] || false + if instance_options && instance_options[:relationships] + instance_options[:relationships].bookmarks_map[object.id] || false else current_user.account.bookmarked?(object) end |