From 032a17b9b665cf1146085192c1f35df29e8f5ab3 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 21 Aug 2017 16:30:50 +0800 Subject: [PATCH] small fix --- app/controllers/member_counselors_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/member_counselors_controller.rb b/app/controllers/member_counselors_controller.rb index 5eb3d84..247f0bb 100644 --- a/app/controllers/member_counselors_controller.rb +++ b/app/controllers/member_counselors_controller.rb @@ -38,9 +38,9 @@ class MemberCounselorsController < CUserController files = [] city = HpsCity.find(params[:city_id]) if !params[:type].present? || params[:type] == "proposals" - hpsfiles = HpsFile.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) + hpsfiles = HpsFile.where(:hps_city_id => city.id).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) elsif params[:type] == "results" - hpsfiles = HpsResult.where(:hps_member_id.in => members).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) + hpsfiles = HpsResult.where(:hps_city_id => city.id).order_by([:year, :desc],[:created_at, :desc]).page(params[:page]).per(10) end hpsfiles.each do |file| files << {