Add participants to community

This commit is contained in:
taitus
2017-08-07 16:39:45 +02:00
parent bc95b6f28d
commit 08f58b845d
3 changed files with 12 additions and 1 deletions

View File

@@ -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