Permalink
Browse files

Make PostgreSQL play nice with its friends. (matches -> ILIKE instead…

… of LIKE)
  • Loading branch information...
1 parent 3a994b9 commit 5ca0c9a45788a14b9f454c93cd24fb0ae12a896b @ernie ernie committed Sep 29, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/arel/visitors/postgresql.rb
@@ -21,6 +21,14 @@ def visit_Arel_Nodes_SelectStatement o
end
end
+ def visit_Arel_Nodes_Matches o
+ "#{visit o.left} ILIKE #{visit o.right}"
+ end
+
+ def visit_Arel_Nodes_DoesNotMatch o
+ "#{visit o.left} NOT ILIKE #{visit o.right}"
+ end
+
def using_distinct_on?(o)
o.cores.any? do |core|
core.projections.any? do |projection|

0 comments on commit 5ca0c9a

Please sign in to comment.