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
|
|
@ -1,4 +1,4 @@
|
|||
- cache [conference, conference.venue, '#splash#header'] do
|
||||
- cache [conference, venue, '#splash#header'] do
|
||||
#banner
|
||||
.container
|
||||
.row
|
||||
|
|
@ -18,14 +18,13 @@
|
|||
= date_string(conference.start_date, conference.end_date)
|
||||
- if conference.venue
|
||||
%span.venue.text-nowrap
|
||||
- if conference.venue.website
|
||||
= sanitize link_to(conference.venue.name,
|
||||
conference.venue.website)
|
||||
- if venue.website
|
||||
= sanitize link_to(venue.name, venue.website)
|
||||
- else
|
||||
= conference.venue.city
|
||||
- if conference.venue.country_name != 'US'
|
||||
= venue.city
|
||||
- if venue.country_name != 'US'
|
||||
•
|
||||
= conference.venue.country_name
|
||||
= venue.country_name
|
||||
|
||||
- unless conference.description.blank?
|
||||
%section#about
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue