summaryrefslogtreecommitdiff
path: root/app/services/applications/create_service.rb
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-10-10 16:47:27 +1300
committerThong Kuah <tkuah@gitlab.com>2018-10-15 11:07:47 +1300
commitcc1ccbf83a4a20f367011a6aec3d158214cfeb34 (patch)
treee593c381c5df19daf43481011e0ad69ad0ceefa5 /app/services/applications/create_service.rb
parentda4f77957ccff7cdf22110ef56a4286bbc5a7749 (diff)
downloadgitlab-ce-cc1ccbf83a4a20f367011a6aec3d158214cfeb34.tar.gz
Move non-controller code into dedicated service
This should help with code re-use when we create applications for group level cluster next. Change `find_or_initialize_by` to explicitly find or build the right association based on the application name. The benefit here is that we use the associations on @cluster rather than querying from the other side of the association.
Diffstat (limited to 'app/services/applications/create_service.rb')
-rw-r--r--app/services/applications/create_service.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/services/applications/create_service.rb b/app/services/applications/create_service.rb
index 3d88c4f064e..b6c30da4d3a 100644
--- a/app/services/applications/create_service.rb
+++ b/app/services/applications/create_service.rb
@@ -9,6 +9,7 @@ module Applications
end
# rubocop: enable CodeReuse/ActiveRecord
+ # EE would override and use `request` arg
def execute(request)
Doorkeeper::Application.create(@params)
end