diff --git a/app/models/user.rb b/app/models/user.rb index 60536195b..4d44456d6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -313,6 +313,11 @@ class User < ActiveRecord::Base follows.map{|follow| follow.followable.tags.map(&:name)}.flatten.compact.uniq end + def self.community_participants(community) + topics_ids = community.topics.pluck(:id) + User.joins(:comments).where("comments.commentable_id IN (?) and comments.commentable_type = 'Topic'", topics_ids) + end + private def clean_document_number diff --git a/app/views/communities/show.html.erb b/app/views/communities/show.html.erb index 363644e17..33eaf47d4 100644 --- a/app/views/communities/show.html.erb +++ b/app/views/communities/show.html.erb @@ -20,3 +20,10 @@ <%= link_to t("topic.new"), new_community_topic_path(@community.id), class: 'button expanded' %> + +