SQL optimisation rolled back. It lead to access problems.

This commit is contained in:
Christoph Haas 2021-03-01 02:07:55 +01:00
parent 7227f769c0
commit 2b24083653
5 changed files with 15 additions and 19 deletions

View file

@ -1,7 +1,6 @@
class WelcomeController < ApplicationController
def home
# TODO: Only approved screenshots!
@newest_upload = Screenshot.newest.accessible_by(current_ability, :view).first
@newest_upload = Screenshot.where(approved: true).first
@most_popular_package = Package.with_screenshots.order(visits: :desc).first