diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/nodes/insert_statement.rb | 2 | ||||
-rw-r--r-- | lib/arel/nodes/select_statement.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/depth_first.rb | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/lib/arel/nodes/insert_statement.rb b/lib/arel/nodes/insert_statement.rb index a5e1a0bb9b..37c12f011a 100644 --- a/lib/arel/nodes/insert_statement.rb +++ b/lib/arel/nodes/insert_statement.rb @@ -1,6 +1,6 @@ module Arel module Nodes - class InsertStatement + class InsertStatement < Arel::Nodes::Node attr_accessor :relation, :columns, :values def initialize diff --git a/lib/arel/nodes/select_statement.rb b/lib/arel/nodes/select_statement.rb index 371fd7bf21..6881a66747 100644 --- a/lib/arel/nodes/select_statement.rb +++ b/lib/arel/nodes/select_statement.rb @@ -1,6 +1,6 @@ module Arel module Nodes - class SelectStatement + class SelectStatement < Arel::Nodes::Node attr_reader :cores attr_accessor :limit, :orders, :lock, :offset diff --git a/lib/arel/visitors/depth_first.rb b/lib/arel/visitors/depth_first.rb index 534f9edaf5..d6d3984ce2 100644 --- a/lib/arel/visitors/depth_first.rb +++ b/lib/arel/visitors/depth_first.rb @@ -61,6 +61,13 @@ module Arel alias :visit_Time :terminal alias :visit_TrueClass :terminal + def visit_Arel_Nodes_InsertStatement o + visit o.relation + visit o.columns + visit o.values + @block.call o + end + def visit_Arel_Nodes_SelectCore o visit o.projections visit o.froms |