Class: RailsOnboarding::Flow
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- RailsOnboarding::Flow
- Defined in:
- app/models/rails_onboarding/flow.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.activate!(flow) ⇒ Object
34 35 36 37 38 39 |
# File 'app/models/rails_onboarding/flow.rb', line 34 def self.activate!(flow) transaction do where.not(id: flow.id).update_all(active: false) flow.update!(active: true) end end |
.seed_default! ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/models/rails_onboarding/flow.rb', line 25 def self.seed_default! create!( name: "Current Configuration", description: "Flow from current configuration", steps: RailsOnboarding.configuration.steps, active: true ) end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 |
# File 'app/models/rails_onboarding/flow.rb', line 13 def [](key) public_send(key) end |
#steps ⇒ Object
21 22 23 |
# File 'app/models/rails_onboarding/flow.rb', line 21 def steps Array(super).map { |step| step.is_a?(Hash) ? step.with_indifferent_access : step } end |