From 040516df7762f60f5f8dcd6652259a78320142f0 Mon Sep 17 00:00:00 2001 From: André Bernardes Date: Thu, 19 Mar 2015 19:32:35 -0300 Subject: [PATCH] Fixed custom_roles method replacement on profile_member_controller --- app/controllers/my_profile/profile_members_controller.rb | 2 +- app/models/profile.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/my_profile/profile_members_controller.rb b/app/controllers/my_profile/profile_members_controller.rb index c3781ef..26efff7 100644 --- a/app/controllers/my_profile/profile_members_controller.rb +++ b/app/controllers/my_profile/profile_members_controller.rb @@ -58,7 +58,7 @@ class ProfileMembersController < MyProfileController def change_role @roles = Profile::Roles.organization_member_roles(environment.id) - @custom_roles = Profile::Roles.organization_custom_roles(environment.id, profile.id) + @custom_roles = profile.custom_roles begin @member = profile.members.find(params[:id]) rescue ActiveRecord::RecordNotFound diff --git a/app/models/profile.rb b/app/models/profile.rb index 91d1a22..c93fff9 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -43,7 +43,7 @@ class Profile < ActiveRecord::Base find_role('editor', env_id) end def self.organization_member_roles(env_id) - all_roles(env_id).select{ |r| r.key.match(/^profile_/) unless r.key.blank? } + all_roles(env_id).select{ |r| r.key.match(/^profile_/) unless r.key.blank? || !r.profile_id.nil?} end def self.all_roles(env_id) Role.all :conditions => { :environment_id => env_id } -- libgit2 0.21.2