Commit 5f9d4254

mo khan <mo@mokhan.ca>
2013-05-05 04:37:16
eager fetch avatar in artists listing
1 parent af45a3a
Changed files (1)
app
app/controllers/profiles_controller.rb
@@ -2,7 +2,7 @@ class ProfilesController < ApplicationController
   before_filter :authenticate_user!, :except => [:index, :show]
 
   def index
-    @profiles = User.page(params[:page]).per(12)
+    @profiles = User.includes(:avatar).page(params[:page]).per(12)
   end
 
   def show