From 727a45185d40b6c2288877b0a9a42c62002fcf51 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Thu, 21 Dec 2017 11:26:38 +0100 Subject: [PATCH] FIX: regex should behave the same in Ruby and Postgres --- app/models/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 800221ed1ac..a218d49d791 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -103,7 +103,7 @@ class Post < ActiveRecord::Base when 'string' where('raw ILIKE ?', "%#{pattern}%") when 'regex' - where('raw ~ ?', pattern) + where('raw ~ ?', "(?n)#{pattern}") end }