From bf821d1910a897b9aa77ba74a55ab8f6aae0b9f2 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Mon, 23 Mar 2015 21:18:51 -0300 Subject: [PATCH] return uniq values --- app/models/profile.rb | 2 +- test/unit/api/communities_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index 4f412dc..3efc1f7 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -150,7 +150,7 @@ class Profile < ActiveRecord::Base .where( ['( ( role_assignments.accessor_type = ? AND role_assignments.accessor_id = ? ) OR (profiles.public_profile = ?) )', Profile.name, person.id, true] - ) + ).uniq } # Subclasses must override this method diff --git a/test/unit/api/communities_test.rb b/test/unit/api/communities_test.rb index 771d604..bdfa5e9 100644 --- a/test/unit/api/communities_test.rb +++ b/test/unit/api/communities_test.rb @@ -43,7 +43,7 @@ class CommunitiesTest < ActiveSupport::TestCase should 'list private community for members' do c1 = fast_create(Community) c2 = fast_create(Community, :public_profile => false) - c1.add_member(person) + c2.add_member(person) get "/api/v1/communities?#{params.to_query}" json = JSON.parse(last_response.body) -- libgit2 0.21.2