From c28128ada8eae26ba9a3aeb38078f1396c0e505b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 16 Jul 2019 15:12:42 +0800 Subject: [PATCH] fix competition list filter --- app/controllers/competitions_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/competitions_controller.rb b/app/controllers/competitions_controller.rb index 1a42a9c6..028bab2d 100644 --- a/app/controllers/competitions_controller.rb +++ b/app/controllers/competitions_controller.rb @@ -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