|
|
|
@ -70,12 +70,21 @@ class Users::SubjectService
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def manage_subject_status_filter(relations)
|
|
|
|
|
status = case params[:status]
|
|
|
|
|
when 'editing' then 0
|
|
|
|
|
when 'applying' then 1
|
|
|
|
|
when 'published' then 2
|
|
|
|
|
end
|
|
|
|
|
relations = relations.where(status: status) if status
|
|
|
|
|
if params[:status] == "publiced"
|
|
|
|
|
relations = relations.where(public: 2)
|
|
|
|
|
elsif params[:status] == "applying"
|
|
|
|
|
relations = relations.where(public: 1)
|
|
|
|
|
else
|
|
|
|
|
status = case params[:status]
|
|
|
|
|
when 'editing' then
|
|
|
|
|
0
|
|
|
|
|
when 'applying' then
|
|
|
|
|
1
|
|
|
|
|
when 'published' then
|
|
|
|
|
2
|
|
|
|
|
end
|
|
|
|
|
relations = relations.where(status: status) if status
|
|
|
|
|
end
|
|
|
|
|
relations
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|