logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: a6ea7e282fc0cbb837cb1c1e344c31264600114c
parent: e5c0aa6493427b7251da558897877f8aa6ad8e4e
Author: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Date:   Tue, 25 Jul 2017 23:01:03 +0900

Merge queries in Api::V1::FavouritesController (#4359)


Diffstat:

Mapp/controllers/api/v1/favourites_controller.rb4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/controllers/api/v1/favourites_controller.rb b/app/controllers/api/v1/favourites_controller.rb @@ -20,9 +20,7 @@ class Api::V1::FavouritesController < Api::BaseController def cached_favourites cache_collection( - Status.where( - id: results.map(&:status_id) - ), + Status.reorder(nil).joins(:favourites).merge(results), Status ) end