Commit f817bcc6

mo k <mo@mokhan.ca>
2013-02-14 14:03:19
fix paging bug
1 parent 25c6a70
Changed files (1)
app
app/services/queries/find_all_creations_query.rb
@@ -4,7 +4,8 @@ class FindAllCreationsQuery
     @mapper = mapper
   end
   def fetch(params)
-    make_pageable(find_creations, params[:page])
+    find_creations.page(params[:page]).per(9)
+    #make_pageable(find_creations, params[:page])
     #make_pageable(find_creations.map {|c| @mapper.map_from(c) }, params[:page])
   end
 
@@ -12,9 +13,6 @@ class FindAllCreationsQuery
 
   def find_creations
     Creation.joins(:photos).where(:is_restricted => false).uniq
-    #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)