class GoodData::LCM2::SynchronizeMeta

Constants

DESCRIPTION
PARAMS

Public Class Methods

call(params) click to toggle source
# File lib/gooddata/lcm/actions/synchronize_meta.rb, line 29
def call(params)
  results = []

  client = params.gdc_gd_client
  development_client = params.development_client

  params.synchronize.each 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|
      client.projects(entry[:pid])
    end

    GoodData::LCM.transfer_meta(from_project, to_projects)

    to_projects.each do |project|
      results << {
        from: from,
        to: project.pid,
        status: 'ok'
      }
    end
  end

  # Return results
  results
end