Commit 051ad5d9

mo khan <mo@mokhan.ca>
2013-05-05 04:23:59
eager fetch users when loading all creations
1 parent feca3b9
Changed files (1)
app
app/services/queries/find_all_creations_query.rb
@@ -10,6 +10,6 @@ class FindAllCreationsQuery
   private
 
   def find_creations
-    Creation.joins(:photos).where(:is_restricted => false).uniq
+    Creation.includes(:user).joins(:photos).where(:is_restricted => false).uniq.includes(:user)
   end
 end