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 466 466: def sql_operator(operator, field) 467: raise ScopedSearch::QueryNotSupported, "the operator '#{operator}' is not supported for field type '#{field.type}'" if [:like, :unlike].include?(operator) and !field.textual? 468: case operator 469: when :like then 'ILIKE' 470: when :unlike then 'NOT ILIKE' 471: else super(operator, field) 472: end 473: end