From ab6c1bd682d153ff779b2a1fff97e38176d1c24f Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 22 Jun 2019 09:45:42 +0800 Subject: [PATCH] fix user projects filter bug --- app/services/users/subject_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/users/subject_service.rb b/app/services/users/subject_service.rb index e0d8377c2..7e3eaaa81 100644 --- a/app/services/users/subject_service.rb +++ b/app/services/users/subject_service.rb @@ -65,7 +65,7 @@ class Users::SubjectService when 'finished' then subjects.having('finished = 1').map(&:id) end - relations.where(id: subject_ids) if subject_ids.present? + relations = relations.where(id: subject_ids) if subject_ids.present? relations end @@ -75,7 +75,7 @@ class Users::SubjectService when 'applying' then 1 when 'published' then 2 end - relations.where(status: status) if status + relations = relations.where(status: status) if status relations end