Sha256: 8f19094b6072d04b51ced2f07648611d808fb0e89c219d4e37d4eff73b2194ae

Contents?: true

Size: 1.16 KB

Versions: 37

Compression:

Stored size: 1.16 KB

Contents

module Actions
  module Candlepin
    module Product
      class Update < Candlepin::Abstract
        def plan(product)
          product.deleted_content.each do |product_content|
            plan_action(::Actions::Candlepin::Product::ContentRemove,
                        :product_id => product.cp_id,
                        :content_id => product_content.content.id)
            plan_action(::Actions::Candlepin::Product::ContentDestroy,
                        :content_id => product_content.content.id)
          end

          product.added_content.each do |pc|
            content_create = plan_action(::Actions::Candlepin::Product::ContentCreate,
                                         :name => pc.content.name,
                                         :type => pc.content.type,
                                         :label => pc.content.label,
                                         :content_url => pc.content.contentUrl)
            plan_action(::Actions::Candlepin::Product::ContentAdd,
                        :product_id => product.cp_id,
                        :content_id => content_create.output[:response][:id])
          end
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
katello-3.3.2 app/lib/actions/candlepin/product/update.rb
katello-3.3.1.1 app/lib/actions/candlepin/product/update.rb
katello-3.3.1 app/lib/actions/candlepin/product/update.rb
katello-3.3.0.1 app/lib/actions/candlepin/product/update.rb
katello-3.3.0 app/lib/actions/candlepin/product/update.rb
katello-3.3.0.rc2 app/lib/actions/candlepin/product/update.rb
katello-3.3.0.rc1.1 app/lib/actions/candlepin/product/update.rb
katello-3.3.0.rc1 app/lib/actions/candlepin/product/update.rb
katello-3.2.1.1 app/lib/actions/candlepin/product/update.rb
katello-3.2.1 app/lib/actions/candlepin/product/update.rb
katello-3.2.0 app/lib/actions/candlepin/product/update.rb
katello-3.2.0.rc3 app/lib/actions/candlepin/product/update.rb
katello-3.2.0.rc2 app/lib/actions/candlepin/product/update.rb
katello-3.2.0.rc1.1 app/lib/actions/candlepin/product/update.rb
katello-3.2.0.rc1 app/lib/actions/candlepin/product/update.rb
katello-3.1.0.1 app/lib/actions/candlepin/product/update.rb
katello-3.1.0 app/lib/actions/candlepin/product/update.rb
katello-3.1.0.rc2.1 app/lib/actions/candlepin/product/update.rb
katello-3.0.2 app/lib/actions/candlepin/product/update.rb
katello-2.4.5 app/lib/actions/candlepin/product/update.rb