app/controllers/admin/posts_controller.rb in spree_cms-0.0.3 vs app/controllers/admin/posts_controller.rb in spree_cms-0.0.4
- old
+ new
@@ -31,14 +31,19 @@
# Note: the SL scopes are on/off switches, so we need to select "not_deleted" explicitly if the switch is off
# QUERY - better as named scope or as SL scope?
#if params[:search].nil? || params[:search][:deleted_at_not_null].blank?
# base_scope = base_scope.not_deleted
#end
+
+ @search = Post.searchlogic(params[:search])
- @search = Post.search(params[:search])
- @search.order ||= "ascend_by_title"
+ # @search = Post.search(params[:search])
+ # @search.order ||= "ascend_by_title"
- @collection = @search.paginate( :page => params[:page] )
+ @collection = @search.do_search.paginate(
+ :per_page => (Spree::Config[:per_page]||50),
+ :page => params[:page]
+ )
else
@collection = Post.title_contains(params[:q]).all(:include => includes, :limit => 10)
@collection.uniq!
end
\ No newline at end of file