Class: Katello::ContentViewModuleStreamFilter
Constant Summary
collapse
- CONTENT_TYPE =
ModuleStream::CONTENT_TYPE
Katello::ContentViewFilter::CONTENT_OPTIONS, Katello::ContentViewFilter::CONTENT_TYPES, Katello::ContentViewFilter::DEB, Katello::ContentViewFilter::DOCKER, Katello::ContentViewFilter::ERRATA, Katello::ContentViewFilter::MODULE_STREAM, Katello::ContentViewFilter::PACKAGE_GROUP, Katello::ContentViewFilter::RPM
Instance Method Summary
collapse
applicable, #applicable_repos, #as_json, class_for, #content_type, create_for, deb, docker, errata, #filter_type, module_stream, #original_packages=, #params_format, #resulting_products, rule_class_for, rule_ids_for, #validate_content_view, #validate_filter_repos, yum
Methods inherited from Model
#destroy!
Instance Method Details
#content_unit_pulp_ids(repo, dependents = false) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/models/katello/content_view_module_stream_filter.rb', line 22
def content_unit_pulp_ids(repo, dependents = false)
content_unit_ids = []
module_ids = []
self.module_stream_rules.each do |rule|
module_ids << rule.module_stream_id
end
if self.original_module_streams
module_ids.concat(repo.module_streams_without_errata.map(&:id))
end
modules_streams = ModuleStream.where(id: module_ids).includes(:rpms)
content_unit_ids += modules_streams.pluck(:pulp_id).flatten.uniq
if dependents && !modules_streams.empty?
rpms = modules_streams.map(&:rpms).flatten
content_unit_ids += rpms.pluck(:pulp_id).flatten.uniq
end
content_unit_ids.uniq
end
|
#generate_clauses(repo) ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'app/models/katello/content_view_module_stream_filter.rb', line 9
def generate_clauses(repo)
rules = module_stream_rules || []
ids = rules.map(&:module_stream_id)
if self.original_module_streams
ids.concat(repo.module_streams_without_errata.map(&:id))
end
ids
end
|
#original_module_streams=(value) ⇒ Object
18
19
20
|
# File 'app/models/katello/content_view_module_stream_filter.rb', line 18
def original_module_streams=(value)
self[:original_module_streams] = value
end
|