Class: Katello::Api::V2::PackageGroupsController

Inherits:
ApiController
  • Object
show all
Includes:
Concerns::Api::V2::RepositoryContentController
Defined in:
app/controllers/katello/api/v2/package_groups_controller.rb

Instance Method Summary collapse

Methods inherited from ApiController

#full_result_response, #resource_class, #scoped_search

Methods included from Rendering

#respond_for_async, #respond_for_bulk_async, #respond_for_create, #respond_for_destroy, #respond_for_index, #respond_for_show, #respond_for_status, #respond_for_update, #respond_with_template, #respond_with_template_collection, #respond_with_template_resource, #try_specific_collection_template, #try_specific_resource_template

Methods included from Katello::Api::Version2

#api_version

Instance Method Details

#available_for_content_view_filter(filter, collection) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/katello/api/v2/package_groups_controller.rb', line 6

def available_for_content_view_filter(filter, collection)
  collection_ids = []
  current_ids = filter.package_group_rules.map(&:uuid)
  filter.applicable_repos.each do |repo|
    collection_ids.concat(repo.package_groups.map(&:uuid))
  end
  collection = PackageGroup.where(:uuid => collection_ids)
  collection = collection.where("uuid not in (?)", current_ids) unless current_ids.empty?
  collection
end

#default_sortObject



17
18
19
# File 'app/controllers/katello/api/v2/package_groups_controller.rb', line 17

def default_sort
  %w(name asc)
end