Permalink
Browse files

Use correct query parameter for sorting in zones, orders and reports

admin controllers

Fixes #1630
  • Loading branch information...
1 parent 210b02f commit 8d6ab7e8585905014c98585fa7552c60e00ee61f @cwise cwise committed with radar Jun 4, 2012
@@ -12,7 +12,7 @@ def index
params[:q] ||= {}
params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
@show_only_completed = params[:q][:completed_at_not_null].present?
- params[:q][:meta_sort] ||= @show_only_completed ? 'completed_at.desc' : 'created_at.desc'
+ params[:q][:s] ||= @show_only_completed ? 'completed_at desc' : 'created_at desc'
if !params[:q][:created_at_gt].blank?
params[:q][:created_at_gt] = Time.zone.parse(params[:q][:created_at_gt]).beginning_of_day rescue ""
@@ -32,7 +32,7 @@ def sales_total
params[:q][:completed_at_not_null] = false
end
- params[:q][:meta_sort] ||= "created_at.desc"
+ params[:q][:s] ||= "created_at desc"
@search = Order.complete.ransack(params[:q])
@orders = @search.result
@@ -12,7 +12,7 @@ def new
def collection
params[:q] ||= {}
- params[:q][:meta_sort] ||= "ascend_by_name"
+ params[:q][:s] ||= "ascend_by_name"
@search = super.ransack(params[:q])
@zones = @search.result.page(params[:page]).per(Spree::Config[:orders_per_page])
end

0 comments on commit 8d6ab7e

Please sign in to comment.