From 8478f9c3b42056a293be1ce45484c036aebb3470 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 7 Mar 2019 11:27:08 +0800 Subject: [PATCH] =?UTF-8?q?member=5Fcount=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/subject.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/subject.rb b/app/models/subject.rb index 4388839c..c416974e 100644 --- a/app/models/subject.rb +++ b/app/models/subject.rb @@ -39,6 +39,10 @@ class Subject < ActiveRecord::Base count end + def member_count + self.shixuns.map(&:myshixuns_count).sum + end + def subject_shixuns count = 0 self.stage_shixuns.each do |stage_shixun|