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

@ -7,7 +7,7 @@ class Context < ApplicationRecord
scope :active, -> { where state: :active }
scope :hidden, -> { where state: :hidden }
scope :closed, -> { where state: :closed }
scope :with_name, lambda { |name| where("name LIKE ?", name) }
scope :with_name, lambda { |name| where("name " + Common.like_operator + " ?", name) }
acts_as_list :scope => :user, :top_of_list => 0