mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 07:10:12 +01:00
Make LIKE searches case-insensitive also on PgSQL
This commit is contained in:
parent
e89511aec8
commit
bbb9fc8809
7 changed files with 21 additions and 11 deletions
|
|
@ -6,4 +6,14 @@ module Common
|
|||
@user_theme = SITE_CONFIG['default_theme'] || 'light_blue'
|
||||
end
|
||||
end
|
||||
|
||||
def self.like_operator
|
||||
# This is something of a hack to use the correct operator for Pg
|
||||
if ActiveRecord::Base.connection.adapter_name.downcase.to_sym == :postgresql
|
||||
like = 'ILIKE'
|
||||
else
|
||||
like = 'LIKE'
|
||||
end
|
||||
return like
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue