From d5ea5cef49f81e681d5767f37185d4cfa3089e67 Mon Sep 17 00:00:00 2001 From: Sean Linsley Date: Fri, 29 Dec 2017 12:36:28 -0600 Subject: [PATCH] test fixes --- lib/ransack/configuration.rb | 2 +- lib/ransack/nodes/grouping.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ransack/configuration.rb b/lib/ransack/configuration.rb index 498cd2b7f..a2dc4d1c8 100644 --- a/lib/ransack/configuration.rb +++ b/lib/ransack/configuration.rb @@ -14,7 +14,7 @@ def initialize @sorted_names_with_underscores = [] end - delegate :[], :keys, to: :@collection + delegate :[], :keys, :has_key?, to: :@collection def []=(key, value) @sorted_names_with_underscores << [key, '_' + key] diff --git a/lib/ransack/nodes/grouping.rb b/lib/ransack/nodes/grouping.rb index bab036cdb..760344115 100644 --- a/lib/ransack/nodes/grouping.rb +++ b/lib/ransack/nodes/grouping.rb @@ -191,7 +191,7 @@ def read_attribute(name) end def strip_predicate_and_index(str) - string = str[/(.+?)\(/, 1] || str + string = str[/(.+?)\(/, 1] || str.dup Predicate.detect_and_strip_from_string!(string) string end