fix user projects filter bug

dev_course
p31729568 6 years ago
parent 7ddd0c4f5d
commit ab6c1bd682

@ -65,7 +65,7 @@ class Users::SubjectService
when 'finished' then subjects.having('finished = 1').map(&:id) when 'finished' then subjects.having('finished = 1').map(&:id)
end end
relations.where(id: subject_ids) if subject_ids.present? relations = relations.where(id: subject_ids) if subject_ids.present?
relations relations
end end
@ -75,7 +75,7 @@ class Users::SubjectService
when 'applying' then 1 when 'applying' then 1
when 'published' then 2 when 'published' then 2
end end
relations.where(status: status) if status relations = relations.where(status: status) if status
relations relations
end end

Loading…
Cancel
Save