class Teneo::DataModel::Task

noinspection ALL

Constants

STAGE_LIST

Public Class Methods

from_hash(hash, id_tags = [:name]) click to toggle source
Calls superclass method Teneo::DataModel::Base::from_hash
# File lib/teneo/data_model/task.rb, line 21
def self.from_hash(hash, id_tags = [:name])
  params = hash.delete(:parameters)
  item = super(hash, id_tags)
  if params
    item.parameter_defs.clear
    params.each do |name, definition|
      item.parameter_defs <<
          Teneo::DataModel::ParameterDef.from_hash(definition.merge(name: name,
                                                                    with_parameters_id: item.id,
                                                                    with_parameters_type: item.class.name))
    end
    item.save!
  end
  item
end