diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-07 18:31:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-07 18:31:37 -0700 |
commit | 8c6b6542f18914544ef95570ac822bf851ac209b (patch) | |
tree | 69ba0766bceb520a317da4f2fe3a7774ec71d95c /lib/arel/visitors/postgresql.rb | |
parent | d4cc1e33b80a546a58bcd2eaa49ea4c5e9682cbc (diff) | |
parent | 6296617c159d5cee0ba1c76f4ea983e3b5e26b6b (diff) | |
download | rails-8c6b6542f18914544ef95570ac822bf851ac209b.tar.gz rails-8c6b6542f18914544ef95570ac822bf851ac209b.tar.bz2 rails-8c6b6542f18914544ef95570ac822bf851ac209b.zip |
Merge pull request #248 from chewi/master
Add Regexp and NotRegexp nodes for PostgreSQL
Diffstat (limited to 'lib/arel/visitors/postgresql.rb')
-rw-r--r-- | lib/arel/visitors/postgresql.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/visitors/postgresql.rb b/lib/arel/visitors/postgresql.rb index 812710181c..49f7482e7d 100644 --- a/lib/arel/visitors/postgresql.rb +++ b/lib/arel/visitors/postgresql.rb @@ -11,6 +11,14 @@ module Arel "#{visit o.left} NOT ILIKE #{visit o.right}" end + def visit_Arel_Nodes_Regexp o + "#{visit o.left} ~ #{visit o.right}" + end + + def visit_Arel_Nodes_NotRegexp o + "#{visit o.left} !~ #{visit o.right}" + end + def visit_Arel_Nodes_DistinctOn o "DISTINCT ON ( #{visit o.expr} )" end |