Sha256: 5d9726f6bce4635610518cf9e80c6cf4fec2a432ea92cd74a4a85707df8cdda0

Contents?: true

Size: 861 Bytes

Versions: 8

Compression:

Stored size: 861 Bytes

Contents

module Katello
  module Concerns
    module ContentFacetHostsControllerExtensions
      extend ActiveSupport::Concern
      included do
        before_action :set_up_content_view_environment, only: [:update]

        def set_up_content_view_environment
          return unless @host&.content_facet.present? && params[:host]&.[](:content_facet_attributes)&.present?
          cv_id = params[:host][:content_facet_attributes].delete(:content_view_id)
          env_id = params[:host][:content_facet_attributes].delete(:lifecycle_environment_id)
          Rails.logger.info "#{__method__}: cv_id=#{cv_id}, env_id=#{env_id}"
          @host.content_facet.assign_single_environment(
            lifecycle_environment_id: env_id,
            content_view_id: cv_id
          )
          Rails.logger.info "#{__method__}: done"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
katello-4.11.1 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.11.0 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.11.0.rc2 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.11.0.rc1 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.10.0 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.9.2 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.10.0.rc2 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb
katello-4.10.0.rc1 app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb