Class ScopedSearch::QueryBuilder::MysqlAdapter
In: lib/scoped_search/query_builder.rb
Parent: ScopedSearch::QueryBuilder

The MysqlAdapter makes sure that case sensitive comparisons are used when using the (not) equals operator, regardless of the field‘s collation setting.

Methods

Public Instance methods

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

[Source]

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

[Validate]