1 class PipelineInstance < ArvadosBase
2 attr_accessor :pipeline_template
4 def self.goes_in_projects?
10 PipelineTemplate.find(pipeline_template_uuid).name
16 def update_job_parameters(new_params)
17 self.components[:steps].each_with_index do |step, i|
18 step[:params].each do |param|
19 if new_params.has_key?(new_param_name = "#{i}/#{param[:name]}") or
20 new_params.has_key?(new_param_name = "#{step[:name]}/#{param[:name]}") or
21 new_params.has_key?(new_param_name = param[:name])
23 %w(hash data_locator).collect(&:to_sym).each do |ptype|
24 param_type = ptype if param.has_key? ptype
26 param[param_type] = new_params[new_param_name]
32 def attribute_editable? attr, *args
33 super && (attr.to_sym == :name ||
34 (attr.to_sym == :components and
35 (self.state == 'New' || self.state == 'Ready')))
38 def attributes_for_display
39 super.reject { |k,v| k == 'components' }