Sha256: e561ea0b59744d34ad2e95b313b54cc6682198b7beb8a91ea061c22e669e476a

Contents?: true

Size: 887 Bytes

Versions: 12

Compression:

Stored size: 887 Bytes

Contents

module ForemanSalt
  module Concerns
    module SaltHostgroupParameters
      extend ActiveSupport::Concern
      include Foreman::Controller::Parameters::LookupKey

      class_methods do
        def salt_hostgroup_params_filter
          Foreman::ParameterFilter.new(Hostgroup).tap do |filter|
            filter.permit hostgroup: [:salt_environment_id, :salt_proxy_id, { salt_module_ids: [] }]
            filter.permit_by_context :required, nested: true
            filter.permit_by_context :id, ui: false, api: true, nested: true

            add_lookup_key_params_filter(filter)
          end
        end
      end

      def salt_hostgroup_params
        param_name = parameter_filter_context.api? ? 'hostgroup' : 'foreman_salt_salt_hostgroup'
        self.class.salt_hostgroup_params_filter.filter_params(params, parameter_filter_context, param_name)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman_salt-17.0.0 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-16.0.3 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-16.0.2 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-16.0.1 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-16.0.0 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-15.2.3 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-15.2.2 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-15.2.1 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-15.2.0 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-15.1.0 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-15.0.0 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb
foreman_salt-14.1.0 app/controllers/foreman_salt/concerns/salt_hostgroup_parameters.rb