module Ransack::Constants
def escape_regex(unescaped)
def escape_regex(unescaped) Regexp.escape(unescaped) end
def escape_wildcards(unescaped)
def escape_wildcards(unescaped) case ActiveRecord::Base.connection.adapter_name when "Mysql2".freeze, "PostgreSQL".freeze # Necessary for PostgreSQL and MySQL unescaped.to_s.gsub(/([\\|\%|_|.])/, '\\\\\\1') else unescaped end end