mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-08 21:07:08 +10:00
#22 Try to fix the sort issue
This commit is contained in:
@@ -11,7 +11,11 @@ class Api::V1::EmSourcesController < ApplicationController
|
||||
def activest_users
|
||||
user_ids = ShareInstance.group(:user_id).count.keys.reverse
|
||||
paginated_ids = Kaminari.paginate_array(user_ids).page(params[:page]).per(25)
|
||||
render json: User.find(paginated_ids).index_by(&:id).slice(*paginated_ids).values, each_serializer: EMUserSerializer
|
||||
|
||||
records = User.find(paginated_ids).group_by(&:id)
|
||||
sorted_records = paginated_ids.map { |id| records[id].first }
|
||||
|
||||
render json: sorted_records, each_serializer: EMUserSerializer
|
||||
end
|
||||
|
||||
def hottest_posts_in_month
|
||||
|
||||
Reference in New Issue
Block a user