Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

admin controllers

Fixes #1630
  • Loading branch information...
commit 8d6ab7e8585905014c98585fa7552c60e00ee61f 1 parent 210b02f
@cwise cwise authored radar committed
View
2  core/app/controllers/spree/admin/orders_controller.rb
@@ -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 ""
View
2  core/app/controllers/spree/admin/reports_controller.rb
@@ -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
View
2  core/app/controllers/spree/admin/zones_controller.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.