about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-07-25 23:01:03 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-07-25 16:01:03 +0200
commita6ea7e282fc0cbb837cb1c1e344c31264600114c (patch)
tree60fd466602a437f1312d335090fcf89809295646 /app
parente5c0aa6493427b7251da558897877f8aa6ad8e4e (diff)
Merge queries in Api::V1::FavouritesController (#4359)
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/favourites_controller.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/api/v1/favourites_controller.rb b/app/controllers/api/v1/favourites_controller.rb
index 92c0a62a9..9d73bb337 100644
--- 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