2018-07-16 12:31:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-24 02:38:06 -04:00
|
|
|
module Applications
|
|
|
|
class CreateService
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2017-10-24 02:38:06 -04:00
|
|
|
def initialize(current_user, params)
|
|
|
|
@current_user = current_user
|
2018-06-02 19:16:36 -04:00
|
|
|
@params = params.except(:ip_address)
|
2017-10-24 02:38:06 -04:00
|
|
|
end
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2017-10-24 02:38:06 -04:00
|
|
|
|
2018-06-07 07:22:29 -04:00
|
|
|
def execute(request)
|
2017-10-24 02:38:06 -04:00
|
|
|
Doorkeeper::Application.create(@params)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|