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

pull/4364/head
Akihiko Odaki 2017-07-25 23:01:03 +09:00 committed by Eugen Rochko
parent e5c0aa6493
commit a6ea7e282f
1 changed files with 1 additions and 3 deletions

View File

@ -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