From f8137075d5a615e968a4b63af13e1c51c36153df Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 18:03:13 +0300 Subject: [PATCH] Show correct group membership in profile --- app/controllers/profiles/groups_controller.rb | 2 +- app/views/profiles/groups/index.html.haml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/profiles/groups_controller.rb b/app/controllers/profiles/groups_controller.rb index 793d2a3..e276d07 100644 --- a/app/controllers/profiles/groups_controller.rb +++ b/app/controllers/profiles/groups_controller.rb @@ -2,7 +2,7 @@ class Profiles::GroupsController < ApplicationController layout "profile" def index - @groups = current_user.authorized_groups.page(params[:page]).per(20) + @user_groups = current_user.users_groups.page(params[:page]).per(20) end def leave diff --git a/app/views/profiles/groups/index.html.haml b/app/views/profiles/groups/index.html.haml index 63695d7..c7c657a 100644 --- a/app/views/profiles/groups/index.html.haml +++ b/app/views/profiles/groups/index.html.haml @@ -11,9 +11,10 @@ .ui-box .title %strong Groups - (#{@groups.count}) + (#{@user_groups.count}) %ul.well-list - - @groups.each do |group| + - @user_groups.each do |user_group| + - group = user_group.group %li .pull-right - if can?(current_user, :manage_group, group) @@ -28,4 +29,7 @@ = link_to group, class: 'group-name' do = group.name -= paginate @groups + as #{user_group.human_access} + + += paginate @user_groups -- libgit2 0.21.2