projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '19926-pysdk-install-docs-fix'
[arvados.git]
/
services
/
api
/
app
/
models
/
workflow.rb
diff --git
a/services/api/app/models/workflow.rb
b/services/api/app/models/workflow.rb
index ea3e985a4eeb7fd6bf6d725a6f92d8ec820890a0..94890c6632e3b9a8ea6eadf914edd9552ec618e5 100644
(file)
--- a/
services/api/app/models/workflow.rb
+++ b/
services/api/app/models/workflow.rb
@@
-1,29
+1,33
@@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
class Workflow < ArvadosModel
include HasUuid
include KindAndEtag
include CommonApiTemplate
class Workflow < ArvadosModel
include HasUuid
include KindAndEtag
include CommonApiTemplate
- validate :validate_
workflow
+ validate :validate_
definition
before_save :set_name_and_description
api_accessible :user, extend: :common do |t|
t.add :name
t.add :description
before_save :set_name_and_description
api_accessible :user, extend: :common do |t|
t.add :name
t.add :description
- t.add :
workflow
+ t.add :
definition
end
end
- def validate_
workflow
+ def validate_
definition
begin
begin
- @
workflow_yaml = YAML.load self.workflow if !workflow
.nil?
+ @
definition_yaml = YAML.load self.definition if !definition
.nil?
rescue => e
rescue => e
- errors.add :
workflow
, "is not valid yaml: #{e.message}"
+ errors.add :
definition
, "is not valid yaml: #{e.message}"
end
end
def set_name_and_description
old_wf = {}
begin
end
end
def set_name_and_description
old_wf = {}
begin
- old_wf = YAML.load self.
workflow_was if !self.workflow
_was.nil?
+ old_wf = YAML.load self.
definition_was if !self.definition
_was.nil?
rescue => e
logger.warn "set_name_and_description error: #{e.message}"
return
rescue => e
logger.warn "set_name_and_description error: #{e.message}"
return
@@
-33,10
+37,18
@@
class Workflow < ArvadosModel
if !self.changes.include?(a)
v = self.read_attribute(a)
if !v.present? or v == old_wf[a]
if !self.changes.include?(a)
v = self.read_attribute(a)
if !v.present? or v == old_wf[a]
- val = @
workflow_yaml[a] if self.workflow and @workflow
_yaml
+ val = @
definition_yaml[a] if self.definition and @definition
_yaml
self[a] = val
end
end
end
end
self[a] = val
end
end
end
end
+
+ def self.full_text_searchable_columns
+ super - ["definition"]
+ end
+
+ def self.limit_index_columns_read
+ ["definition"]
+ end
end
end