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
|
|
@ -18,7 +18,7 @@
|
|||
.cell.pkgcard data-equalizer-watch=true
|
||||
a.black href=package_path(name: pkg.name)
|
||||
.image
|
||||
= small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
|
||||
= small_img(pkg.screenshots.first, cls: '')
|
||||
.text.pkgname
|
||||
= pkg.name
|
||||
.text
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
.small-12.medium-4.cell.pkgcard
|
||||
a.black href=package_path(name: pkg.name)
|
||||
.image
|
||||
= small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
|
||||
= small_img(pkg.screenshots.first, cls: '')
|
||||
.small-12.medium-8.cell
|
||||
h2
|
||||
a href=package_path(name: pkg.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue