Class: Plutonium::Wizard::Configuration
- Inherits:
-
Object
- Object
- Plutonium::Wizard::Configuration
- Defined in:
- lib/plutonium/wizard/configuration.rb
Overview
Configuration for the Plutonium wizard subsystem.
Exposed via Configuration#wizards.
Instance Attribute Summary collapse
-
#attachment_backend ⇒ Symbol?
The storage backend used to SERVER-SIDE-stage a plain (non-direct-upload) wizard attachment field —
:active_storageor:shrine. -
#cleanup_after ⇒ ActiveSupport::Duration
How long completed/abandoned sessions are kept.
-
#database ⇒ Symbol
Which database wizard tables live in.
-
#enabled ⇒ Boolean
Whether the wizard subsystem (and its migrations) is enabled.
-
#encrypt_data ⇒ Boolean
Encrypt every wizard's staged
dataat rest by default.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Initialize a new wizard Configuration instance with default values.
Constructor Details
#initialize ⇒ Configuration
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_backend ⇒ Symbol?
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.
30 31 32 |
# File 'lib/plutonium/wizard/configuration.rb', line 30 def @attachment_backend end |
#cleanup_after ⇒ ActiveSupport::Duration
Returns how long completed/abandoned sessions are kept.
13 14 15 |
# File 'lib/plutonium/wizard/configuration.rb', line 13 def cleanup_after @cleanup_after end |
#database ⇒ Symbol
Returns which database wizard tables live in.
16 17 18 |
# File 'lib/plutonium/wizard/configuration.rb', line 16 def database @database end |
#enabled ⇒ Boolean
Returns 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_data ⇒ Boolean
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.
22 23 24 |
# File 'lib/plutonium/wizard/configuration.rb', line 22 def encrypt_data @encrypt_data end |