mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-25 18:26:10 +01:00
Forced an earlier load of a user's contexts on the contexts listing page so that calls to size and empty? don't result in additional SQL queries.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@660 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
584fdf2d34
commit
7b40b7f77c
1 changed files with 1 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ class ContextsController < ApplicationController
|
|||
session :off, :only => :index, :if => Proc.new { |req| ['rss','atom','txt'].include?(req.parameters[:format]) }
|
||||
|
||||
def index
|
||||
@contexts = current_user.contexts
|
||||
@contexts = current_user.contexts.reload #reload is called here to force an immediate load so that size and empty? checks later don't result in separate SQL queries
|
||||
init_not_done_counts(['context'])
|
||||
respond_to do |format|
|
||||
format.html &render_contexts_html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue