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' %> + +
+ Participantes + <% User.community_participants(@community).each do |participant| %> + <%= link_to participant.name, user_path(participant)%> + <% end %> +
diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 599c62053..0e62d5606 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -6,7 +6,6 @@ Comunidad: <%= @community.proposal.title %>
<%= render "topics/filter_subnav" %> - <%#= render "proposals/notifications" %>
<%= render "topics/comments" %>