Sha256: 4845e0035df4bd78c19a2c0b90e8d5a387aaf402006db5cf5aef356454e969ef
Contents?: true
Size: 901 Bytes
Versions: 13
Compression:
Stored size: 901 Bytes
Contents
module Katello class Api::V2::PackagesController < Api::V2::ApiController apipie_concern_subst(:a_resource => N_("a package"), :resource => "packages") include Katello::Concerns::Api::V2::RepositoryContentController before_filter :find_repositories, :only => :auto_complete_name def auto_complete_name page_size = Katello::Concerns::FilteredAutoCompleteSearch::PAGE_SIZE rpms = Rpm.in_repositories(@repositories) col = "#{Rpm.table_name}.name" rpms = rpms.where("#{Rpm.table_name}.name ILIKE ?", "#{params[:term]}%").select(col).group(col).order(col).limit(page_size) render :json => rpms.pluck(col) end def find_repositories @repositories = Repository.readable.where(:id => params[:repoids]) end def resource_class Katello::Rpm end def default_sort lambda { |query| query.default_sort } end end end
Version data entries
13 entries across 13 versions & 1 rubygems