From 212413c8b3a07693d53e56bad9d31e2a5be801e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Thu, 6 Feb 2020 11:12:47 +0100 Subject: [PATCH] Avoid mutable q params --- app/controllers/api/products_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb index 96465c24cb..42413e30f4 100644 --- a/app/controllers/api/products_controller.rb +++ b/app/controllers/api/products_controller.rb @@ -143,7 +143,7 @@ module Api end def query_params_with_defaults - params[:q].to_h.reverse_merge!('s' => 'created_at desc') + params[:q].to_h.reverse_merge('s' => 'name asc') end def pagination_data(results)