Commit 19ffa2d9345518fc5bfff6a9ae6678bf112a26b7
1 parent
4bfa4aaa
Exists in
fix_sign_up_form
fix sql error when using the pg_search plugin
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
@@ -255,7 +255,8 @@ class CmsController < MyProfileController | @@ -255,7 +255,8 @@ class CmsController < MyProfileController | ||
255 | end | 255 | end |
256 | 256 | ||
257 | def search_communities_to_publish | 257 | def search_communities_to_publish |
258 | - render :text => find_by_contents(:profiles, environment, user.memberships, params['q'], {:page => 1}, {:fields => ['name']})[:results].map {|community| {:id => community.id, :name => community.name} }.to_json | 258 | + scope = user.memberships.distinct(false).group([:id,:name]) |
259 | + render :text => find_by_contents(:profiles, environment, scope, params['q'], {:page => 1}, {:fields => ['name']})[:results].map {|community| {:id => community.id, :name => community.name} }.to_json | ||
259 | end | 260 | end |
260 | 261 | ||
261 | def publish | 262 | def publish |