Permalink
Browse files

doing a little cleanup on the visitors

  • Loading branch information...
1 parent 1d30f5c commit 691c9d2d9643211bcc2d24f68ef05f0418a157e6 @tenderlove tenderlove committed Oct 19, 2010
Showing with 9 additions and 3 deletions.
  1. +3 −3 lib/arel/visitors/dot.rb
  2. +2 −0 lib/arel/visitors/join_sql.rb
  3. +2 −0 lib/arel/visitors/mysql.rb
  4. +2 −0 lib/arel/visitors/order_clauses.rb
View
6 lib/arel/visitors/dot.rb
@@ -1,6 +1,6 @@
module Arel
module Visitors
- class Dot
+ class Dot < Arel::Visitors::Visitor
class Node # :nodoc:
attr_accessor :name, :id, :fields
@@ -23,7 +23,7 @@ def initialize
end
def accept object
- visit object
+ super
to_dot
end
@@ -188,7 +188,7 @@ def visit o
@seen[node.id] = node
@nodes << node
with_node node do
- send "visit_#{o.class.name.gsub('::', '_')}", o
+ super
end
end
View
2 lib/arel/visitors/join_sql.rb
@@ -9,6 +9,8 @@ module Visitors
# This visitor is used in SelectManager#join_sql and is for backwards
# compatibility with Arel V1.0
class JoinSql < Arel::Visitors::ToSql
+ private
+
def visit_Arel_Nodes_SelectCore o
[o.froms].grep(Nodes::Join).map { |x| visit x }.join ', '
end
View
2 lib/arel/visitors/mysql.rb
@@ -1,6 +1,8 @@
module Arel
module Visitors
class MySQL < Arel::Visitors::ToSql
+ private
+
def visit_Arel_Nodes_UpdateStatement o
[
"UPDATE #{visit o.relation}",
View
2 lib/arel/visitors/order_clauses.rb
@@ -1,6 +1,8 @@
module Arel
module Visitors
class OrderClauses < Arel::Visitors::ToSql
+ private
+
def visit_Arel_Nodes_SelectStatement o
o.orders.map { |x| visit x }
end

0 comments on commit 691c9d2

Please sign in to comment.