favorites: order /favorites.json by id.

Order https://danbooru.donmai.us/favorites.json by favorite ID instead
of by post ID. This way you can get a feed of recently added favorites.
Previously this wasn't possible because we didn't have an index on
favorite ID.
This commit is contained in:
evazion
2021-10-08 21:06:36 -05:00
parent 340e1008e9
commit c4a4e77ca5

View File

@@ -18,7 +18,7 @@ class Favorite < ApplicationRecord
q = q.for_user(params[:user_id])
end
q.order(post_id: :desc)
q.apply_default_order(params)
end
def self.available_includes