1 class Workflow < ArvadosModel
4 include CommonApiTemplate
6 validate :validate_workflow
7 before_save :set_name_and_description
9 api_accessible :user, extend: :common do |t|
17 @workflow_yaml = YAML.load self.workflow if !workflow.nil?
19 errors.add :workflow, "is not valid yaml: #{e.message}"
23 def set_name_and_description
26 old_wf = YAML.load self.workflow_was if !self.workflow_was.nil?
28 logger.warn "set_name_and_description error: #{e.message}"
32 ['name', 'description'].each do |a|
33 if !self.changes.include?(a)
34 v = self.read_attribute(a)
35 if !v.present? or v == old_wf[a]
36 val = @workflow_yaml[a] if self.workflow and @workflow_yaml