diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-01-05 23:05:16 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-01-05 23:05:16 -0200 |
commit | dfd22638c2773d843ea1d2e56992a6ac355b3ecb (patch) | |
tree | 1bf97bcb2f6928a32b6acb93ea9886925a0e21b4 /lib/arel/visitors/depth_first.rb | |
parent | 347c7786f8e7ea0e9643ff707ce1ace8b3969d6c (diff) | |
parent | 4c7e50f9328aca4e294b41fce0832bf6ac4a939a (diff) | |
download | rails-dfd22638c2773d843ea1d2e56992a6ac355b3ecb.tar.gz rails-dfd22638c2773d843ea1d2e56992a6ac355b3ecb.tar.bz2 rails-dfd22638c2773d843ea1d2e56992a6ac355b3ecb.zip |
Merge pull request #400 from felixbuenemann/case-node
Implement CASE Conditional Expression
Diffstat (limited to 'lib/arel/visitors/depth_first.rb')
-rw-r--r-- | lib/arel/visitors/depth_first.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/arel/visitors/depth_first.rb b/lib/arel/visitors/depth_first.rb index 22704dd038..2f71455580 100644 --- a/lib/arel/visitors/depth_first.rb +++ b/lib/arel/visitors/depth_first.rb @@ -16,6 +16,7 @@ module Arel def unary o visit o.expr end + alias :visit_Arel_Nodes_Else :unary alias :visit_Arel_Nodes_Group :unary alias :visit_Arel_Nodes_Grouping :unary alias :visit_Arel_Nodes_Having :unary @@ -53,6 +54,12 @@ module Arel visit o.distinct end + def visit_Arel_Nodes_Case o + visit o.case + visit o.conditions + visit o.default + end + def nary o o.children.each { |child| visit child} end @@ -86,8 +93,9 @@ module Arel alias :visit_Arel_Nodes_Regexp :binary alias :visit_Arel_Nodes_RightOuterJoin :binary alias :visit_Arel_Nodes_TableAlias :binary - alias :visit_Arel_Nodes_Values :binary alias :visit_Arel_Nodes_Union :binary + alias :visit_Arel_Nodes_Values :binary + alias :visit_Arel_Nodes_When :binary def visit_Arel_Nodes_StringJoin o visit o.left |