aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/postgresql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/visitors/postgresql.rb')
-rw-r--r--lib/arel/visitors/postgresql.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/arel/visitors/postgresql.rb b/lib/arel/visitors/postgresql.rb
index 75d2ad9c93..1ef0261bdd 100644
--- a/lib/arel/visitors/postgresql.rb
+++ b/lib/arel/visitors/postgresql.rb
@@ -26,11 +26,13 @@ module Arel
end
def visit_Arel_Nodes_Regexp o, collector
- infix_value o, collector, ' ~ '
+ op = o.case_sensitive ? ' ~ ' : ' ~* '
+ infix_value o, collector, op
end
def visit_Arel_Nodes_NotRegexp o, collector
- infix_value o, collector, ' !~ '
+ op = o.case_sensitive ? ' !~ ' : ' !~* '
+ infix_value o, collector, op
end
def visit_Arel_Nodes_DistinctOn o, collector