Sha256: d0d216ff9a6c9eb5986092c2ce5887a3d988e8f204b39645dd3f9a43f9c8c98a

Contents?: true

Size: 783 Bytes

Versions: 10

Compression:

Stored size: 783 Bytes

Contents

module Actions
  module Katello
    module SyncPlan
      class AddProducts < Actions::EntryAction
        middleware.use Actions::Middleware::PulpServicesCheck

        def plan(sync_plan, product_ids)
          action_subject(sync_plan)

          plan_action(::Actions::Pulp::Repository::EnsureSyncNotification)

          products = ::Katello::Product.where(:id => product_ids).editable
          sync_plan.product_ids = (sync_plan.product_ids + products.collect { |p| p.id }).uniq
          sync_plan.save!

          products.each do |product|
            plan_action(::Actions::Katello::Product::Update, product, :sync_plan_id => sync_plan.id)
          end
        end

        def humanized_name
          _("Add Sync Plan Products")
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
katello-3.8.1 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.7.1.1 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.7.1 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.8.0 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.8.0.rc3 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.8.0.rc2 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.7.0 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.8.0.rc1 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.7.0.rc2 app/lib/actions/katello/sync_plan/add_products.rb
katello-3.7.0.rc1 app/lib/actions/katello/sync_plan/add_products.rb