Commit bf821d1910a897b9aa77ba74a55ab8f6aae0b9f2

Authored by Leandro Santos
Committed by Rodrigo Souto
1 parent 7aad6583

return uniq values

app/models/profile.rb
... ... @@ -150,7 +150,7 @@ class Profile < ActiveRecord::Base
150 150 .where(
151 151 ['( ( role_assignments.accessor_type = ? AND role_assignments.accessor_id = ? ) OR
152 152 (profiles.public_profile = ?) )', Profile.name, person.id, true]
153   - )
  153 + ).uniq
154 154 }
155 155  
156 156 # Subclasses must override this method
... ...
test/unit/api/communities_test.rb
... ... @@ -43,7 +43,7 @@ class CommunitiesTest < ActiveSupport::TestCase
43 43 should 'list private community for members' do
44 44 c1 = fast_create(Community)
45 45 c2 = fast_create(Community, :public_profile => false)
46   - c1.add_member(person)
  46 + c2.add_member(person)
47 47  
48 48 get "/api/v1/communities?#{params.to_query}"
49 49 json = JSON.parse(last_response.body)
... ...