meta_workflows 0.8.11 → 0.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c3e3a281ec142b84464171c5827bcf2b9d0610fcfda6268588727b0c291233b
|
4
|
+
data.tar.gz: 641415e402adbc3fe28ebc786ab718cf3fd73245405d30e2c56935500fea37e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d0502a24725b61701f2e332bdd248dbb32735e239ebeb8667cbe3f751683c9f25e037dbafd269c7ea6ee298049ac39a9dcb29a61ecba4f138f3b93737c0d520
|
7
|
+
data.tar.gz: 324ffa7ee80f572a06166e44e210906027d745e5ddd825a8c5342794fd6c7230adbd41f2b0d602c398bde7878fd68bf0e91eefb822f3f483fe8fbd021aa30cbb
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module MetaWorkflows
|
4
4
|
MAJOR = 0
|
5
5
|
MINOR = 8
|
6
|
-
PATCH =
|
6
|
+
PATCH = 12 # this is automatically incremented by the build process
|
7
7
|
|
8
8
|
VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
|
9
9
|
end
|
@@ -181,17 +181,15 @@ module Services
|
|
181
181
|
|
182
182
|
raise ArgumentError, "Invalid record updater class: #{service_class_name}" unless service_class
|
183
183
|
|
184
|
-
target_record =
|
184
|
+
target_record = find_workflow_record(workflow_execution)
|
185
185
|
attributes_to_update = execution_step['attributes_to_update']
|
186
186
|
|
187
|
-
service_class.new(target_record, attributes_to_update, workflow_execution.workflow_params)
|
187
|
+
service_class.new(target_record, attributes_to_update, workflow_execution.workflow_params, inputs)
|
188
188
|
end
|
189
189
|
|
190
|
-
|
191
|
-
# to only use workflow_params and use better naming (instead of record_id and record_class)
|
192
|
-
def find_parent_record(workflow_execution)
|
190
|
+
def find_workflow_record(workflow_execution)
|
193
191
|
record_class = workflow_execution.record.class.name.constantize
|
194
|
-
record_class.find(workflow_execution.
|
192
|
+
record_class.find(workflow_execution.record_id)
|
195
193
|
end
|
196
194
|
|
197
195
|
def continue_workflow(workflow_execution, workflow)
|
@@ -4,13 +4,14 @@ module Services
|
|
4
4
|
module MetaWorkflows
|
5
5
|
module Updaters
|
6
6
|
class MetaService < Services::MetaWorkflows::ApplicationService
|
7
|
-
attr_reader :record, :attributes_to_update, :workflow_params
|
7
|
+
attr_reader :record, :attributes_to_update, :workflow_params, :inputs
|
8
8
|
|
9
|
-
def initialize(record, attributes_to_update, workflow_params)
|
9
|
+
def initialize(record, attributes_to_update, workflow_params, inputs = {})
|
10
10
|
super()
|
11
11
|
@record = record
|
12
12
|
@attributes_to_update = attributes_to_update
|
13
13
|
@workflow_params = workflow_params
|
14
|
+
@inputs = inputs
|
14
15
|
end
|
15
16
|
|
16
17
|
def call
|
@@ -25,7 +26,9 @@ module Services
|
|
25
26
|
attributes_hash = {}
|
26
27
|
|
27
28
|
attributes_to_update.each do |attribute_name|
|
28
|
-
|
29
|
+
# Check inputs first, then workflow_params
|
30
|
+
param_value = inputs[attribute_name] || inputs[attribute_name.to_sym] ||
|
31
|
+
workflow_params[attribute_name] || workflow_params[attribute_name.to_sym]
|
29
32
|
next if param_value.blank?
|
30
33
|
|
31
34
|
attributes_hash[attribute_name.to_sym] = param_value
|