Class: ForemanPuppet::PuppetclassLookupKeysController
Instance Method Summary
collapse
#puppetclass_lookup_key_params
Instance Method Details
#index ⇒ Object
7
8
9
10
11
12
13
|
# File 'app/controllers/foreman_puppet/puppetclass_lookup_keys_controller.rb', line 7
def index
@lookup_keys = resource_base_search_and_page.distinct.preload(:lookup_values)
environment_classes = EnvironmentClass.where(puppetclass_lookup_key_id: @lookup_keys.map(&:id)).select(:puppetclass_id, :puppetclass_lookup_key_id).distinct.preload(:puppetclass)
puppetclass_ids = environment_classes.map(&:puppetclass_id).uniq
@puppetclass_authorizer = Authorizer.new(User.current, collection: puppetclass_ids)
@lookup_keys_to_class = environment_classes.map { |environment_class| [environment_class.puppetclass_lookup_key_id, environment_class.puppetclass] }.to_h
end
|
#resource_class ⇒ Object
15
16
17
|
# File 'app/controllers/foreman_puppet/puppetclass_lookup_keys_controller.rb', line 15
def resource_class
model_of_controller
end
|