Add collaborative legislation summary again
It was removed in commit 128a8164 because we hadn't reviewed it nor
tested it properly. We're now adding it again, fixing the issues we've
found while reviewing.
This commit is contained in:
@@ -40,4 +40,8 @@ class Legislation::DraftVersion < ApplicationRecord
|
||||
def total_comments
|
||||
annotations.sum(:comments_count)
|
||||
end
|
||||
|
||||
def best_comments
|
||||
Comment.where(commentable: annotations, ancestry: nil).sort_by_supports.limit(10)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user