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,21 +2,21 @@
|
|||
%li
|
||||
%a.smoothscroll{ href: '#lodging' } Lodging
|
||||
|
||||
- cache [conference.venue, conference.lodgings, '#splash#lodging'] do
|
||||
- cache [venue, lodgings, '#splash#lodging'] do
|
||||
%section#lodging
|
||||
.container
|
||||
.row
|
||||
.col-md-12.text-center
|
||||
%h2
|
||||
Where to stay
|
||||
- if conference.venue
|
||||
- if venue
|
||||
in
|
||||
= conference.venue.city
|
||||
= venue.city
|
||||
%p.lead
|
||||
We recommend the following accommodations for your visit.
|
||||
|
||||
.row.row-centered
|
||||
- conference.lodgings.each do |lodging|
|
||||
- lodgings.each do |lodging|
|
||||
.col-md-4.col-sm-4.col-centered.col-top
|
||||
.thumbnail
|
||||
- if lodging.picture?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue