Class: Katello::ContentViewPackageFilter
- Inherits:
-
ContentViewFilter
- Object
- ActiveRecord::Base
- Model
- ContentViewFilter
- Katello::ContentViewPackageFilter
- Defined in:
- app/models/katello/content_view_package_filter.rb
Constant Summary collapse
- CONTENT_TYPE =
Rpm::CONTENT_TYPE
Constants inherited from ContentViewFilter
Katello::ContentViewFilter::CONTENT_OPTIONS, Katello::ContentViewFilter::CONTENT_TYPES, Katello::ContentViewFilter::ERRATA, Katello::ContentViewFilter::PACKAGE_GROUP, Katello::ContentViewFilter::RPM
Instance Method Summary collapse
-
#generate_clauses(repo) ⇒ Array
Returns a set of Pulp/MongoDB conditions to filter out packages in the repo repository that match parameters.
- #original_packages=(value) ⇒ Object
Methods inherited from ContentViewFilter
applicable, #applicable_repos, #as_json, class_for, #content_type, create_for, #filter_type, #params_format, #resulting_products, rule_class_for, rule_ids_for, #validate_content_view, #validate_filter_repos, yum
Methods inherited from Model
Instance Method Details
#generate_clauses(repo) ⇒ Array
Returns a set of Pulp/MongoDB conditions to filter out packages in the repo repository that match parameters
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/katello/content_view_package_filter.rb', line 14 def generate_clauses(repo) package_filenames = [] self.package_rules.each do |rule| package_filenames.concat(query_rpms(repo, rule)) end if self.original_packages package_filenames.concat(repo.packages_without_errata.map(&:filename)) end { 'filename' => { "$in" => package_filenames } } unless package_filenames.empty? end |
#original_packages=(value) ⇒ Object
27 28 29 |
# File 'app/models/katello/content_view_package_filter.rb', line 27 def original_packages=(value) self[:original_packages] = value end |