Skip to content

A platform for community discussion. Free, open, simple.

FIX: regex should behave the same in Ruby and Postgres

Gerhard Schlager727a45185d40
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
}