Class | ScopedSearch::QueryBuilder::PostgreSQLAdapter |
In: |
lib/scoped_search/query_builder.rb
|
Parent: | ScopedSearch::QueryBuilder |
The PostgreSQLAdapter make sure that searches are case sensitive when using the like/unlike operators, by using the PostrgeSQL-specific ILIKE operator instead of LIKE.
Switches out the default LIKE operator for ILIKE in the default sql_operator method.
# File lib/scoped_search/query_builder.rb, line 454 454: def sql_operator(operator, field) 455: raise ScopedSearch::QueryNotSupported, "the operator '#{operator}' is not supported for field type '#{field.type}'" if [:like, :unlike].include?(operator) and !field.textual? 456: case operator 457: when :like then 'ILIKE' 458: when :unlike then 'NOT ILIKE' 459: else super(operator, field) 460: end 461: end