Class: Plutonium::Wizard::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/plutonium/wizard/configuration.rb

Overview

Configuration for the Plutonium wizard subsystem.

Exposed via Configuration#wizards.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Initialize a new wizard Configuration instance with default values.



33
34
35
36
37
38
39
# File 'lib/plutonium/wizard/configuration.rb', line 33

def initialize
  @enabled = false
  @cleanup_after = 14.days
  @database = :primary
  @encrypt_data = false
  @attachment_backend = nil
end

Instance Attribute Details

#attachment_backendSymbol?

Returns the storage backend used to SERVER-SIDE-stage a plain (non-direct-upload) wizard attachment field — :active_storage or :shrine. nil auto-detects (active_shrine loaded → :shrine, else :active_storage). A field may override with input …, backend:. Only relevant when a file rides the step POST; direct-upload fields already arrive as a token and ignore this.

Returns:

  • (Symbol, nil)

    the storage backend used to SERVER-SIDE-stage a plain (non-direct-upload) wizard attachment field — :active_storage or :shrine. nil auto-detects (active_shrine loaded → :shrine, else :active_storage). A field may override with input …, backend:. Only relevant when a file rides the step POST; direct-upload fields already arrive as a token and ignore this.



30
31
32
# File 'lib/plutonium/wizard/configuration.rb', line 30

def attachment_backend
  @attachment_backend
end

#cleanup_afterActiveSupport::Duration

Returns how long completed/abandoned sessions are kept.

Returns:

  • (ActiveSupport::Duration)

    how long completed/abandoned sessions are kept



13
14
15
# File 'lib/plutonium/wizard/configuration.rb', line 13

def cleanup_after
  @cleanup_after
end

#databaseSymbol

Returns which database wizard tables live in.

Returns:

  • (Symbol)

    which database wizard tables live in



16
17
18
# File 'lib/plutonium/wizard/configuration.rb', line 16

def database
  @database
end

#enabledBoolean

Returns whether the wizard subsystem (and its migrations) is enabled.

Returns:

  • (Boolean)

    whether the wizard subsystem (and its migrations) is enabled



10
11
12
# File 'lib/plutonium/wizard/configuration.rb', line 10

def enabled
  @enabled
end

#encrypt_dataBoolean

Returns encrypt every wizard's staged data at rest by default. Off by default because it needs ActiveRecord encryption keys configured; a wizard may still opt in (encrypt_data) or out (encrypt_data false) individually regardless of this default.

Returns:

  • (Boolean)

    encrypt every wizard's staged data at rest by default. Off by default because it needs ActiveRecord encryption keys configured; a wizard may still opt in (encrypt_data) or out (encrypt_data false) individually regardless of this default.



22
23
24
# File 'lib/plutonium/wizard/configuration.rb', line 22

def encrypt_data
  @encrypt_data
end