class ScopedSearch::QueryBuilder::Mysql2Adapter

Public Instance Methods

sql_operator(operator, field) click to toggle source

Patches the default sql_operator method to add BINARY after the equals and not equals operator to force case-sensitive comparisons.

# File lib/scoped_search/query_builder.rb, line 449
def sql_operator(operator, field)
  if [:ne, :eq].include?(operator) && field.textual?
    "#{SQL_OPERATORS[operator]} BINARY"
  else
    super(operator, field)
  end
end