X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3ee8ac519f0c3f3fd211372d2a4699586d5c2aa8..e3e54264e8bc767e1ec773cff4e5bdf4c4934a36:/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 936905713e..f575e20d4e 100644 --- a/apps/workbench/app/models/pipeline_instance.rb +++ b/apps/workbench/app/models/pipeline_instance.rb @@ -47,10 +47,16 @@ 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) + if name.to_s == "components" + (ever or %w(New Ready).include?(state)) and super + else + super + end end def attributes_for_display