Skip to content

Commit

Permalink
Eager load stories and notes in stories#index
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolm Locke committed Nov 2, 2011
1 parent dcc670c commit b601826
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/stories_controller.rb
Expand Up @@ -3,7 +3,8 @@ class StoriesController < ApplicationController
include ActionView::Helpers::TextHelper

def index
@project = current_user.projects.find(params[:project_id])
@project = current_user.projects.find(params[:project_id],
:include => {:stories => :notes})
@stories = @project.stories
respond_to do |format|
format.json { render :json => @stories }
Expand Down

0 comments on commit b601826

Please sign in to comment.