mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-08 21:07:08 +10:00
remove unscoped from timeline controller
This commit is contained in:
@@ -17,7 +17,7 @@ class Api::V1::TimelineController < Api::V1::ApplicationController
|
||||
stars_ids = @current_user.stars.ids
|
||||
user_ids = stars_ids + [@current_user.id]
|
||||
posts_ids = TimelineSource.where(user_id: user_ids).order(created_at: :desc).page(params[:page]).pluck(:post_id).uniq
|
||||
render json: Post.unscoped.find(posts_ids).index_by(&:id).slice(*posts_ids).values, each_serializer: EachPostSerializer
|
||||
render json: Post.find(posts_ids).index_by(&:id).slice(*posts_ids).values, each_serializer: EachPostSerializer
|
||||
else
|
||||
return most_liked
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user