From a175a8ac83dadfac351effbb787f7dd2c355c387 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 8 Nov 2019 15:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=90=8D=E4=BA=BA=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/trustie_hacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/trustie_hacks_controller.rb b/app/controllers/trustie_hacks_controller.rb index 0ae56383c..462a5a057 100644 --- a/app/controllers/trustie_hacks_controller.rb +++ b/app/controllers/trustie_hacks_controller.rb @@ -15,7 +15,7 @@ class TrustieHacksController < ApplicationController hacks = hacks.where("name like ?", "%#{search}%") end - @hackathon_users_count = hacks ? 0 : hacks.sum(:hack_users_count) + @hackathon_users_count = hacks.blank? ? 0 : hacks.sum(:hack_users_count) @hacks_count = hacks.count @hacks = hacks.page(page).per(limit)