aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/depth_first.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-09-22 11:01:03 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-09-22 11:01:03 -0700
commitb57a11cb8abfca345f63084ce841c6f412c1156e (patch)
treec58702c92ba90e121a4556bc4053a0e6b790873f /lib/arel/visitors/depth_first.rb
parentc903c6b28933a041d42d943c6c83f98aaa81f42a (diff)
downloadrails-b57a11cb8abfca345f63084ce841c6f412c1156e.tar.gz
rails-b57a11cb8abfca345f63084ce841c6f412c1156e.tar.bz2
rails-b57a11cb8abfca345f63084ce841c6f412c1156e.zip
move the dispatch table to be per-instance
visitors are not shared among threads, so any mutations to the cache should be OK. The cache is also pre-populated on construction, but we should pull that out so we can share the cache among visitors in the future.
Diffstat (limited to 'lib/arel/visitors/depth_first.rb')
-rw-r--r--lib/arel/visitors/depth_first.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/arel/visitors/depth_first.rb b/lib/arel/visitors/depth_first.rb
index eab20ac831..a434f404c7 100644
--- a/lib/arel/visitors/depth_first.rb
+++ b/lib/arel/visitors/depth_first.rb
@@ -3,6 +3,7 @@ module Arel
class DepthFirst < Arel::Visitors::Visitor
def initialize block = nil
@block = block || Proc.new
+ super()
end
private
@@ -86,6 +87,7 @@ module Arel
alias :visit_Arel_Nodes_RightOuterJoin :binary
alias :visit_Arel_Nodes_TableAlias :binary
alias :visit_Arel_Nodes_Values :binary
+ alias :visit_Arel_Nodes_Union :binary
def visit_Arel_Nodes_StringJoin o
visit o.left
@@ -116,6 +118,8 @@ module Arel
alias :visit_Arel_Nodes_SqlLiteral :terminal
alias :visit_Arel_Nodes_BindParam :terminal
alias :visit_Arel_Nodes_Window :terminal
+ alias :visit_Arel_Nodes_True :terminal
+ alias :visit_Arel_Nodes_False :terminal
alias :visit_BigDecimal :terminal
alias :visit_Bignum :terminal
alias :visit_Class :terminal