Skip to content

Commit

Permalink
PostGIS also needs ILIKE to do case insensitve search
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlarsen committed Sep 19, 2012
1 parent 2dfd45d commit 2f0fffa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hobo/lib/hobo/model/scopes/automatic_scopes.rb
Expand Up @@ -319,7 +319,7 @@ def create_scope(check_only=false)
return true if check_only

def_scope do |query, *fields|
match_keyword = ::ActiveRecord::Base.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
match_keyword = %w(PostgreSQL PostGIS).include?(::ActiveRecord::Base.connection.adapter_name) ? "ILIKE" : "LIKE"

words = query.split
args = []
Expand Down

0 comments on commit 2f0fffa

Please sign in to comment.