From b6d2547a0d8369b7d1e3ba13bd5ed3fe95118d72 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Wed, 4 Jun 2014 01:28:40 -0400 Subject: [PATCH] changed wildcard escape logic --- lib/ransack/constants.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ransack/constants.rb b/lib/ransack/constants.rb index b77d92e..bd0dc7c 100644 --- a/lib/ransack/constants.rb +++ b/lib/ransack/constants.rb @@ -89,11 +89,11 @@ module Ransack # replace % \ to \% \\ def escape_wildcards(unescaped) case ActiveRecord::Base.connection.adapter_name - when "SQLite" - unescaped - else + when "Mysql2", "PostgreSQL" # Necessary for PostgreSQL and MySQL unescaped.to_s.gsub(/([\\|\%|.])/, '\\\\\\1') + else + unescaped end end end