From ee145cf9bf8ee67ce2e7f1a9cd90dd6fb017bc72 Mon Sep 17 00:00:00 2001 From: Junv Zhao Date: Thu, 3 Dec 2015 00:13:42 +0800 Subject: [PATCH] shit --- app/controllers/api/v1/timeline_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/timeline_controller.rb b/app/controllers/api/v1/timeline_controller.rb index f690251..5d58441 100644 --- a/app/controllers/api/v1/timeline_controller.rb +++ b/app/controllers/api/v1/timeline_controller.rb @@ -16,7 +16,7 @@ class Api::V1::TimelineController < Api::V1::ApplicationController if @current_user 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 + posts_ids = TimelineSource.where(user_id: user_ids).order(created_at: :desc).page(params[:page]).pluck(:post_id) render json: Post.find(posts_ids).index_by(&:id).slice(*posts_ids).values, each_serializer: EachPostSerializer else return most_liked