Project

General

Profile

« Previous | Next » 

Revision 8ba0380d

Added by Justin Sherrill about 10 years ago

fixes #4782 - speeding up CV Version content count methods

Also adapting Package to use normal tire search and moving old
search method to legacy_search

View differences:

app/models/katello/content_view_version.rb
end
def package_count
packages.count
Package.package_count(self.repositories.archived)
end
def errata
repositories.archived.flat_map(&:errata)
end
def errata_count
errata.count
def errata_count(errata_type = nil)
Errata.errata_count(self.repositories.archived, errata_type)
end
def errata_type_counts
Errata::TYPES.each_with_object({}) do |type, counts|
counts[type] = errata.select { |err| err.type == type }.count
counts[type] = errata_count(type)
end
end

Also available in: Unified diff