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

master
Akihiko Odaki 8 years ago committed by Eugen Rochko
parent e5c0aa6493
commit a6ea7e282f
  1. 4
      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

Loading…
Cancel
Save