aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/postgresql.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-29 13:39:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-29 13:39:37 -0700
commitc8f83d61a113ae3c01005d2ac02e4c17891d918c (patch)
tree1cdd7fef7be6274731dc89569df52a600c4841e0 /lib/arel/visitors/postgresql.rb
parent5ec2fac114b1c70fe7ac87f4767b6f1cbc1e78fc (diff)
parent5ca0c9a45788a14b9f454c93cd24fb0ae12a896b (diff)
downloadrails-c8f83d61a113ae3c01005d2ac02e4c17891d918c.tar.gz
rails-c8f83d61a113ae3c01005d2ac02e4c17891d918c.tar.bz2
rails-c8f83d61a113ae3c01005d2ac02e4c17891d918c.zip
Merge remote branch 'ernie/master'
* ernie/master: Make PostgreSQL play nice with its friends. (matches -> ILIKE instead of LIKE) Add support for remaining *_any/*_all attribute methods, and add matches/does_not_match/not_in Add eq_any.
Diffstat (limited to 'lib/arel/visitors/postgresql.rb')
-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|