From 909bebf46a34ad04d19c5163b2f72c7488a51fc0 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Mon, 8 Dec 2014 01:07:56 +0100 Subject: [PATCH] Remove a stray hash mutation from #sort_link The idea is to centralize all mutations and brittle, order-dependent operations in the `initialize` method. --- lib/ransack/helpers/form_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ransack/helpers/form_helper.rb b/lib/ransack/helpers/form_helper.rb index d2d462b..f7fc32b 100644 --- a/lib/ransack/helpers/form_helper.rb +++ b/lib/ransack/helpers/form_helper.rb @@ -84,8 +84,11 @@ module Ransack end def options_for_url - @options[@search_object.context.search_key] = search_and_sort_params - params.merge(@options) + params.merge( + @options.merge( + @search_object.context.search_key => search_and_sort_params + ) + ) end def search_and_sort_params