diff --git a/app/models/legislation/draft_version.rb b/app/models/legislation/draft_version.rb index 297cef236..7b9e6a0aa 100644 --- a/app/models/legislation/draft_version.rb +++ b/app/models/legislation/draft_version.rb @@ -26,4 +26,8 @@ class Legislation::DraftVersion < ActiveRecord::Base def display_title status == 'draft' ? "#{title} *" : title end + + def total_comments + annotations.sum(:comments_count) + end end diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index a68e667e3..32468b834 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -64,7 +64,7 @@ class Legislation::Process < ActiveRecord::Base end def total_comments - questions.sum(:comments_count) + questions.sum(:comments_count) + draft_versions.map(&:total_comments).sum end def status diff --git a/app/views/admin/legislation/draft_versions/index.html.erb b/app/views/admin/legislation/draft_versions/index.html.erb index 6d9418c99..bfe7d33f6 100644 --- a/app/views/admin/legislation/draft_versions/index.html.erb +++ b/app/views/admin/legislation/draft_versions/index.html.erb @@ -41,7 +41,7 @@