Make LIKE searches case-insensitive also on PgSQL

This commit is contained in:
Jyri-Petteri Paloposki 2020-09-05 01:24:23 +03:00
parent e89511aec8
commit bbb9fc8809
7 changed files with 21 additions and 11 deletions

View file

@ -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