Class: ScopedSearch::QueryBuilder::Mysql2Adapter

Inherits:
ScopedSearch::QueryBuilder show all
Defined in:
lib/scoped_search/query_builder.rb

Constant Summary

Constant Summary

Constants inherited from ScopedSearch::QueryBuilder

SQL_OPERATORS

Instance Attribute Summary

Attributes inherited from ScopedSearch::QueryBuilder

#ast, #definition

Instance Method Summary (collapse)

Methods inherited from ScopedSearch::QueryBuilder

#build_find_params, build_query, class_for, #datetime_test, #has_many_through_join, #initialize, #order_by, #set_test, #sql_test, #to_not_sql, #translate_value

Constructor Details

This class inherits a constructor from ScopedSearch::QueryBuilder

Instance Method Details

- (Object) sql_operator(operator, field)

BINARY after the equals and not equals operator to force case-sensitive comparisons.



500
501
502
503
504
505
506
# File 'lib/scoped_search/query_builder.rb', line 500

def sql_operator(operator, field)
  if [:ne, :eq].include?(operator) && field.textual?
    "#{SQL_OPERATORS[operator]} BINARY"
  else
    super(operator, field)
  end
end