diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-04 20:27:34 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-04 20:27:34 -0800 |
commit | f0c4e3713d72a18a4100f85e263014f6e56bfad3 (patch) | |
tree | ccdcde4adb5ebfc4920daff19aa8ad38477b5caf /lib/arel/visitors/depth_first.rb | |
parent | dd1a65456fbfdc1f2a337aca535576d84145dcb6 (diff) | |
download | rails-f0c4e3713d72a18a4100f85e263014f6e56bfad3.tar.gz rails-f0c4e3713d72a18a4100f85e263014f6e56bfad3.tar.bz2 rails-f0c4e3713d72a18a4100f85e263014f6e56bfad3.zip |
Added Arel::Nodes::NamedFunction for representing generic SQL functions
Diffstat (limited to 'lib/arel/visitors/depth_first.rb')
-rw-r--r-- | lib/arel/visitors/depth_first.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/visitors/depth_first.rb b/lib/arel/visitors/depth_first.rb index ed95cad472..914b2d1999 100644 --- a/lib/arel/visitors/depth_first.rb +++ b/lib/arel/visitors/depth_first.rb @@ -28,6 +28,7 @@ module Arel def function o visit o.expressions visit o.alias + visit o.distinct end alias :visit_Arel_Nodes_Avg :function alias :visit_Arel_Nodes_Exists :function @@ -35,6 +36,13 @@ module Arel alias :visit_Arel_Nodes_Min :function alias :visit_Arel_Nodes_Sum :function + def visit_Arel_Nodes_NamedFunction o + visit o.name + visit o.expressions + visit o.distinct + visit o.alias + end + def visit_Arel_Nodes_Count o visit o.expressions visit o.alias |