From 457d4d922899e291d418d1c28dc06618c69ee9b9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 18 Nov 2019 16:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/competition.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/competition.rb b/app/models/competition.rb index 0ffd1c7a5..bb21f0ef8 100644 --- a/app/models/competition.rb +++ b/app/models/competition.rb @@ -150,7 +150,7 @@ class Competition < ApplicationRecord end def charts_count - competition_awards.pluck(:num)&.sum > 0 ? competition_awards.pluck(:num)&.sum : awards_count + competition_awards.pluck(:num)&.sum.to_i > 0 ? competition_awards.pluck(:num)&.sum.to_i : awards_count end def manager?(user)