remove unscoped from timeline controller

This commit is contained in:
2015-12-02 23:47:42 +08:00
parent ce0f9f1cd5
commit d9ebae1324
@@ -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