Sha256: 5cbf0e9d9457e45e6e7430222a78502b4c470b9efdcf396976e26152f14cee1e

Contents?: true

Size: 572 Bytes

Versions: 10

Compression:

Stored size: 572 Bytes

Contents

module ForemanDiscovery
  module Concerns
    module HostsControllerExtensions
      extend ActiveSupport::Concern
      included do
        before_action :set_discovered_params
      end

      # Change params to what the hosts controller expects. Certain methods
      # in the hosts controller like all the _selected methods, taxonomy_scope,
      # etc.. expect a params[:host] to work.
      def set_discovered_params
        return unless request.path.match(/discovered_hosts/).present?
        params[:host] ||= params[:discovered_host]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_discovery-9.1.5 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-9.1.4 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-9.1.3 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-9.1.2 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-9.1.1 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-9.1.0 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-9.0.0 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-8.0.1 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-8.0.0 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
foreman_discovery-7.0.1 app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb