mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-03 14:31:47 +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
|
|
@ -11,8 +11,8 @@ class Project < ApplicationRecord
|
|||
scope :completed, -> { where state: 'completed' }
|
||||
scope :uncompleted, -> { where("NOT(state = ?)", 'completed') }
|
||||
|
||||
scope :with_name_or_description, lambda { |body| where("name LIKE ? OR description LIKE ?", body, body) }
|
||||
scope :with_namepart, lambda { |body| where("name LIKE ?", body + '%') }
|
||||
scope :with_name_or_description, lambda { |body| where("name " + Common.like_operator + " ? OR description " + Common.like_operator + " ?", body, body) }
|
||||
scope :with_namepart, lambda { |body| where("name " + Common.like_operator + " ?", body + '%') }
|
||||
|
||||
before_create :set_last_reviewed_now
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue