cc1ccbf83a
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.
17 lines
427 B
Ruby
17 lines
427 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Applications
|
|
class CreateService
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
def initialize(current_user, params)
|
|
@current_user = current_user
|
|
@params = params.except(:ip_address)
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
|
|
# EE would override and use `request` arg
|
|
def execute(request)
|
|
Doorkeeper::Application.create(@params)
|
|
end
|
|
end
|
|
end
|