Sha256: 804f4c97e572916dd9886269e5c5f7a468af9d6100947dfae43b3857494a9e2e

Contents?: true

Size: 921 Bytes

Versions: 9

Compression:

Stored size: 921 Bytes

Contents

module Katello
  class Api::V2::PackageGroupsController < Api::V2::ApiController
    apipie_concern_subst(:a_resource => N_("a package group"), :resource => "package_groups")
    include Katello::Concerns::Api::V2::RepositoryContentController

    api :GET, "package_groups/:id", N_("show package groups by id")
    def index
      super
    end

    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

    def default_sort
      %w(name asc)
    end

    private

    def repo_association
      :repository_id
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-2.4.5 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.4 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.3 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.2 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.1 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.0 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.0.rc3 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.0.rc2 app/controllers/katello/api/v2/package_groups_controller.rb
katello-2.4.0.rc1 app/controllers/katello/api/v2/package_groups_controller.rb