aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2010-09-29 15:50:24 -0400
committerErnie Miller <ernie@metautonomo.us>2010-09-29 15:50:24 -0400
commit5ca0c9a45788a14b9f454c93cd24fb0ae12a896b (patch)
treec1e951baa4be73645cb9964a6ccb831ac9830bf5
parent3a994b9949daccc2a64d08234af22fda78e49a17 (diff)
downloadrails-5ca0c9a45788a14b9f454c93cd24fb0ae12a896b.tar.gz
rails-5ca0c9a45788a14b9f454c93cd24fb0ae12a896b.tar.bz2
rails-5ca0c9a45788a14b9f454c93cd24fb0ae12a896b.zip
Make PostgreSQL play nice with its friends. (matches -> ILIKE instead of LIKE)
-rw-r--r--lib/arel/visitors/postgresql.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/visitors/postgresql.rb b/lib/arel/visitors/postgresql.rb
index 87fc3bd60d..5e03f40984 100644
--- a/lib/arel/visitors/postgresql.rb
+++ b/lib/arel/visitors/postgresql.rb
@@ -21,6 +21,14 @@ module Arel
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|