Permalink
Browse files

Eager load stories and notes in stories#index

  • Loading branch information...
1 parent dcc670c commit b6018264a20fcff7dc00041acd6ccca2124980fd @malclocke malclocke committed Nov 2, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/controllers/stories_controller.rb
@@ -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 }

0 comments on commit b601826

Please sign in to comment.