2018-07-16 16:31:01 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-24 06:38:06 +00:00
|
|
|
module Applications
|
|
|
|
class CreateService
|
2019-02-06 12:41:17 +00:00
|
|
|
attr_reader :current_user, :params
|
|
|
|
|
2017-10-24 06:38:06 +00:00
|
|
|
def initialize(current_user, params)
|
|
|
|
@current_user = current_user
|
2019-09-18 14:02:45 +00:00
|
|
|
@params = params.except(:ip_address)
|
2017-10-24 06:38:06 +00:00
|
|
|
end
|
|
|
|
|
2018-10-10 03:47:27 +00:00
|
|
|
# EE would override and use `request` arg
|
2018-06-07 11:22:29 +00:00
|
|
|
def execute(request)
|
2019-02-06 12:41:17 +00:00
|
|
|
Doorkeeper::Application.create(params)
|
2017-10-24 06:38:06 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-09-13 13:26:31 +00:00
|
|
|
|
|
|
|
Applications::CreateService.prepend_if_ee('EE::Applications::CreateService')
|