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

@ -3,12 +3,11 @@ class WelcomeController < ApplicationController
# TODO: Only approved screenshots!
@newest_upload = Screenshot.newest_upload
# TODO: Use the actually most popular package and not just a random one
@most_popular_package = Package.order(:visits).last
@most_popular_package = Package.with_screenshots.order(visits: :desc).first
@package_count = Package.count
@most_wanted_package = Package.without_screenshots_most_visits.first
@most_wanted_package = Package.without_screenshots.order(visits: :desc).first
end
def about