Avoid N+1 SQL queries with CanCanCan accessibility checks
This commit is contained in:
parent
f154c1838c
commit
b36a49a6cd
6 changed files with 14 additions and 12 deletions
|
|
@ -63,9 +63,9 @@ class Screenshot < ApplicationRecord
|
|||
self.save!
|
||||
end
|
||||
|
||||
# Get the newest screenshot regardless of the package it belongs to
|
||||
def self.newest_upload
|
||||
self.order(created_at: :desc).where(approved: true).first
|
||||
# Get the newest screenshots regardless of the package it belongs to
|
||||
def self.newest
|
||||
self.order(created_at: :desc)
|
||||
end
|
||||
|
||||
# Return the part of the version up to the first - or +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue