Commit 3b7ca34b

mo khan <mo@mokhan.ca>
2014-08-23 19:26:22
fix select n+1 on dashboard.
1 parent 6f9860f
Changed files (1)
app
app/controllers/my/dashboard_controller.rb
@@ -1,7 +1,7 @@
 module My
   class DashboardController < BaseController
     def index
-      @items = (current_user.creations + current_user.tutorials).sort_by! { |x| x.created_at }.reverse
+      @items = (current_user.creations.includes(:photos) + current_user.tutorials).sort_by! { |x| x.created_at }.reverse
       @activities = current_user.recent_activities
     end
   end