|
|
|
@ -29,9 +29,9 @@ class CompetitionsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
case params[:category]
|
|
|
|
|
when 'nearly_published' then
|
|
|
|
|
competitions = competitions.where('published_at is not null AND status = 0')
|
|
|
|
|
competitions = competitions.where('status = 0')
|
|
|
|
|
when 'progressing' then
|
|
|
|
|
competitions = competitions.where('end_time > NOW()')
|
|
|
|
|
competitions = competitions.where('end_time > NOW() AND status = 1')
|
|
|
|
|
when 'ended' then
|
|
|
|
|
competitions = competitions.where('end_time < NOW()')
|
|
|
|
|
end
|
|
|
|
|