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:
James Mason 2017-12-21 19:06:36 -08:00
parent 754d201b01
commit fa55224163
26 changed files with 181 additions and 165 deletions

View file

@ -5,10 +5,10 @@
.row
.col-md-12
.row.row-centered
- conference.highlighted_events.each do |event|
- highlights.each do |event|
- speaker = event.speakers_ordered.first
.col-md-3.col-sm-3.col-centered.col-top.highlights
= link_to(conference_program_proposal_path(conference.short_title,
= link_to(conference_program_proposal_path(conference_id,
event),
class: 'thumbnail') do
= image_tag speaker.gravatar_url(size: 300),