lib/gooddata/lcm/actions/synchronize_attribute_drillpaths.rb in gooddata-0.6.51 vs lib/gooddata/lcm/actions/synchronize_attribute_drillpaths.rb in gooddata-0.6.52
- old
+ new
@@ -12,32 +12,36 @@
DESCRIPTION = 'Synchronize Attribute Drillpath'
PARAMS = define_params(self) do
description 'Client Used for Connecting to GD'
param :gdc_gd_client, instance_of(Type::GdClientType), required: true
+
+ description 'Development Client Used for Connecting to GD'
+ param :development_client, instance_of(Type::GdClientType), required: true
+
+ description 'Synchronization Info'
+ param :synchronize, array_of(instance_of(Type::SynchronizationInfoType)), required: true, generated: true
end
RESULT_HEADER = [
:from,
:to,
:status
]
class << self
def call(params)
- BaseAction.check_params(PARAMS, params)
-
results = []
client = params.gdc_gd_client
development_client = params.development_client
- params.synchronize.each do |info|
+ params.synchronize.peach do |info|
from = info.from
to = info.to
from_project = development_client.projects(from) || fail("Invalid 'from' project specified - '#{from}'")
- to_projects = to.map do |entry|
+ to_projects = to.pmap do |entry|
pid = entry[:pid]
client.projects(pid) || fail("Invalid 'to' project specified - '#{pid}'")
end
GoodData::LCM.transfer_attribute_drillpaths(from_project, to_projects)