Class: Tasker::NamedStep

Inherits:
ApplicationRecord show all
Defined in:
app/models/tasker/named_step.rb

Class Method Summary collapse

Methods inherited from ApplicationRecord

configure_database_connections, database_configuration_exists?

Class Method Details

.create_named_steps_from_templates(templates) ⇒ Object



32
33
34
35
36
37
38
39
# File 'app/models/tasker/named_step.rb', line 32

def self.create_named_steps_from_templates(templates)
  templates.map do |template|
    dependent_system = Tasker::DependentSystem.find_or_create_by!(name: template.dependent_system)
    named_step = NamedStep.find_or_create_by!(name: template.name,
                                              dependent_system_id: dependent_system.dependent_system_id)
    named_step
  end
end