Commit 2045defb

mo k <mo@mokhan.ca>
2013-02-06 04:54:58
attempt to improve creations load time
1 parent a9ff2e1
Changed files (1)
app
app/services/queries/find_all_creations_query.rb
@@ -11,9 +11,10 @@ class FindAllCreationsQuery
   private
 
   def find_creations
-    Creation.all.select do |creation|
-      creation.published? && creation.is_safe_for_children?
-    end
+    Creation.joins(:photos).where(:is_restricted => false)
+    #Creation.all.select do |creation|
+      #creation.published? && creation.is_safe_for_children?
+    #end
   end
   def make_pageable(items, page)
     Kaminari.paginate_array(items).page(page).per(9)