FIX: regex should behave the same in Ruby and Postgres

This commit is contained in:
Gerhard Schlager
2017-12-21 11:26:38 +01:00
parent 16076f9ab8
commit 727a45185d

View File

@ -103,7 +103,7 @@ class Post < ActiveRecord::Base
when 'string' when 'string'
where('raw ILIKE ?', "%#{pattern}%") where('raw ILIKE ?', "%#{pattern}%")
when 'regex' when 'regex'
where('raw ~ ?', pattern) where('raw ~ ?', "(?n)#{pattern}")
end end
} }