Commit c221ecbd

mo khan <mo@mokhan.ca>
2014-09-24 02:53:44
fix select n+1
1 parent 27b2340
Changed files (1)
app
models
app/models/user.rb
@@ -81,7 +81,7 @@ class User < ActiveRecord::Base
   end
 
   def favorite_cakes
-    favorites.includes(:creation).map {|f| f.creation }
+    favorites.includes(creation: [:photos, :user]).map { |f| f.creation }
   end
 
   def create_cake(name:, category:)