summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-01 18:17:03 +0200
committerRémy Coutable <remy@rymai.me>2016-06-14 13:07:26 +0200
commitd75edf1a9854b2ab609c7d3acf5eee1ca89e8db9 (patch)
treef727b323c1ce9fd4419aea65c8c4aac4f07570b0 /app
parentd71fbe0dbdb3b7aba6f71e6d3d50daaa890769e9 (diff)
downloadgitlab-ce-d75edf1a9854b2ab609c7d3acf5eee1ca89e8db9.tar.gz
Factorize access request routes into a new :access_requestable route concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app')
-rw-r--r--app/controllers/concerns/access_request_actions.rb2
-rw-r--r--app/helpers/members_helper.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/access_request_actions.rb b/app/controllers/concerns/access_request_actions.rb
index 1b0a1fe3081..c4d22749d6a 100644
--- a/app/controllers/concerns/access_request_actions.rb
+++ b/app/controllers/concerns/access_request_actions.rb
@@ -8,7 +8,7 @@ module AccessRequestActions
notice: 'Your request for access has been queued for review.'
end
- def approve
+ def approve_access_request
@member = access_requestable_resource.public_send(member_entity_name.pluralize).request.find(params[:id])
return render_403 unless can?(current_user, :"update_#{member_entity_name}", @member)
diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb
index 6599c59d1c9..bd84b8b239f 100644
--- a/app/helpers/members_helper.rb
+++ b/app/helpers/members_helper.rb
@@ -53,9 +53,9 @@ module MembersHelper
def approve_request_member_path(member)
case member.source
when Project
- approve_namespace_project_project_member_path(member.source.namespace, member.source, member)
+ approve_access_request_namespace_project_project_member_path(member.source.namespace, member.source, member)
when Group
- approve_group_group_member_path(member.source, member)
+ approve_access_request_group_group_member_path(member.source, member)
else
raise ArgumentError.new('Unknown object class')
end