summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-22 17:01:00 +0200
committerRémy Coutable <remy@rymai.me>2016-09-22 17:02:47 +0200
commit76232d541baebb25ca3536364e27b379e5356460 (patch)
tree24a047bb0276570f69bde7a29cadcbd9c3156d4b
parent94edafdf09fdc36054dcc3a71b34649a48c2a357 (diff)
downloadgitlab-ce-76232d541baebb25ca3536364e27b379e5356460.tar.gz
Use AccessRequestable#request_access in MembershipActionsrc-new-members-request-access-service
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--app/controllers/concerns/membership_actions.rb2
-rw-r--r--lib/api/access_requests.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/concerns/membership_actions.rb b/app/controllers/concerns/membership_actions.rb
index 1d34441e8ea..52682ef9dc9 100644
--- a/app/controllers/concerns/membership_actions.rb
+++ b/app/controllers/concerns/membership_actions.rb
@@ -3,7 +3,7 @@ module MembershipActions
include MembersHelper
def request_access
- Members::RequestAccessService.new(membershipable, current_user).execute
+ membershipable.request_access(current_user)
redirect_to polymorphic_path(membershipable),
notice: 'Your request for access has been queued for review.'
diff --git a/lib/api/access_requests.rb b/lib/api/access_requests.rb
index 895847add9e..29a97ccbd75 100644
--- a/lib/api/access_requests.rb
+++ b/lib/api/access_requests.rb
@@ -33,7 +33,7 @@ module API
# POST /projects/:id/access_requests
post ":id/access_requests" do
source = find_source(source_type, params[:id])
- access_requester = ::Members::RequestAccessService.new(source, current_user).execute
+ access_requester = source.request_access(current_user)
if access_requester.persisted?
present access_requester.user, with: Entities::AccessRequester, access_requester: access_requester