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

@ -18,7 +18,8 @@
.cell.pkgcard data-equalizer-watch=true
a.black href=package_path(name: pkg.name)
.image
= small_img(pkg.screenshots.first, cls: '')
/ This leads to an N+1 SQL query for each image. Ideas for optimization welcome.
= small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
.text.pkgname
= pkg.name
.text
@ -29,7 +30,8 @@
.small-12.medium-4.cell.pkgcard
a.black href=package_path(name: pkg.name)
.image
= small_img(pkg.screenshots.first, cls: '')
/ This leads to an N+1 SQL query for each image. Ideas for optimization welcome.
= small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
.small-12.medium-8.cell
h2
a href=package_path(name: pkg.name)