Cope with new installation without screenshots

This commit is contained in:
Christoph Haas 2018-08-22 13:10:22 +02:00
parent ea3769501b
commit 0207cb194b
3 changed files with 12 additions and 13 deletions

View file

@ -52,12 +52,6 @@ class Package < ApplicationRecord
where.not(id: subselect)
end
# Packages that need screenshots and have most visits.
# These packages are most likely to need a screenshot.
def self.without_screenshots_most_visits
self.without_screenshots.order(visits: :desc)
end
# Return a query of all approved/public screenshots of this package
def screenshots_approved
self.screenshots.where(approved: true)