Package.without_screenshots_most_visits added
This commit is contained in:
parent
046897f1c6
commit
dbca1e0a19
1 changed files with 6 additions and 0 deletions
|
|
@ -40,6 +40,12 @@ class Package < ActiveRecord::Base
|
||||||
where.not(id: subselect)
|
where.not(id: subselect)
|
||||||
end
|
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
|
# Return a query of all approved/public screenshots of this package
|
||||||
def screenshots_approved
|
def screenshots_approved
|
||||||
self.screenshots.find_by(approved: true)
|
self.screenshots.find_by(approved: true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue