X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1f1963df75f584d575fd440206e3ac64064cf06c..66c13b6055a363cb08197b8c5d040ed9a511c8ca:/apps/workbench/app/models/pipeline_instance.rb diff --git a/apps/workbench/app/models/pipeline_instance.rb b/apps/workbench/app/models/pipeline_instance.rb index 89acbb0dbb..83328b9e52 100644 --- a/apps/workbench/app/models/pipeline_instance.rb +++ b/apps/workbench/app/models/pipeline_instance.rb @@ -5,10 +5,14 @@ class PipelineInstance < ArvadosBase true end - def friendly_link_name + def friendly_link_name lookup=nil pipeline_name = self.name if pipeline_name.nil? or pipeline_name.empty? - template = PipelineTemplate.where(uuid: self.pipeline_template_uuid).first + template = if lookup and lookup[self.pipeline_template_uuid] + lookup[self.pipeline_template_uuid] + else + PipelineTemplate.where(uuid: self.pipeline_template_uuid).first + end if template template.name else @@ -43,10 +47,12 @@ class PipelineInstance < ArvadosBase end end - def attribute_editable? attr, *args - super && (attr.to_sym == :name || attr.to_sym == :description || - (attr.to_sym == :components and - (self.state == 'New' || self.state == 'Ready'))) + def editable_attributes + %w(name description components) + end + + def attribute_editable?(name, ever=nil) + (ever or %w(New Ready).include?(state)) and super end def attributes_for_display