mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-10 09:24:22 +01:00
Learned a better way to force an immediate load of an association (passing (true)) and applied it to the index action of the contexts and projects controller. Thanks to teferi in @nyc.rb for the assist.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@661 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
7b40b7f77c
commit
1516d7ae14
2 changed files with 3 additions and 3 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.reload #reload is called here to force an immediate load so that size and empty? checks later don't result in separate SQL queries
|
||||
@contexts = current_user.contexts(true) #true is passed 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