Skip to content

Commit

Permalink
Merge pull request #866 from amatsuda/escape_only_wildcards
Browse files Browse the repository at this point in the history
Let escape_wildcards not escape '|'
  • Loading branch information
scarroll32 authored Feb 5, 2018
2 parents 7557c12 + b93854c commit be40da9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ransack/adapters/active_record/ransack/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ 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')
unescaped.to_s.gsub(/([\\%_.])/, '\\\\\\1')
else
unescaped
end
Expand Down

0 comments on commit be40da9

Please sign in to comment.