Use SQL to sum the comments

This commit is contained in:
Fernando Blat
2017-01-05 11:14:12 +01:00
parent ba0089ac44
commit 450fcc3e04

View File

@@ -56,7 +56,7 @@ class Legislation::Process < ActiveRecord::Base
end
def total_comments
questions.map(&:comments_count).sum
questions.sum(:comments_count)
end
def status