Commit 5b4c38f78cbeccb24cb3f4bcec7587d4ea3686f1

Authored by Leandro Santos
1 parent 33871f09

return uniq values

app/models/profile.rb
... ... @@ -139,7 +139,7 @@ class Profile < ActiveRecord::Base
139 139 .where(
140 140 ['( ( role_assignments.accessor_type = ? AND role_assignments.accessor_id = ? ) OR
141 141 (profiles.public_profile = ?) )', Profile.name, person.id, true]
142   - )
  142 + ).uniq
143 143 }
144 144  
145 145 # 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)
... ...