Break up the one-query-of-doom
The single query was producing a tremendously large ActiveRecord allocation. While this isn't nearly as cool as one query, it's still a significant reduction in SQL trips, and now has the bonus of only loading what is actually going to be displayed.
This commit is contained in:
parent
754d201b01
commit
fa55224163
26 changed files with 181 additions and 165 deletions
|
|
@ -2,7 +2,7 @@
|
|||
%li
|
||||
%a.smoothscroll{ href: '#tickets' } Tickets
|
||||
|
||||
- cache [conference, conference.tickets, '#splash#tickets'] do
|
||||
- cache [conference, tickets, '#splash#tickets'] do
|
||||
%section#tickets
|
||||
.container
|
||||
.row
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
Support
|
||||
= conference.title
|
||||
.row.row-centered
|
||||
- conference.tickets.each do |ticket|
|
||||
- tickets.each do |ticket|
|
||||
.col-md-3.col-sm-3.col-centered.col-top
|
||||
= link_to(conference_tickets_path(conference.short_title),
|
||||
class: 'thumbnail') do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue