Class: Booth::Adminland::Credentials::Create

Inherits:
Object
  • Object
show all
Includes:
Logging, MethodObject
Defined in:
lib/booth/adminland/credentials/create.rb

Instance Method Summary collapse

Methods included from MethodObject

included

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/booth/adminland/credentials/create.rb', line 12

def call
  creation = ::Booth::Credentials::Create.call(
    username:,
    allowed_modes:,
    scope:
  )

  return creation if creation.failure?

  # Not exposing the ActiveRecord model outside of Booth.
  Tron.success :credential_created,
               id: creation.credential.id,
               scope: creation.credential.scope,
               allowed_modes: creation.credential.allowed_modes.map(&:to_sym)
end