diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-29 14:30:06 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-29 14:30:06 -0800 |
commit | ad16c18cc3a7db4b56611b9244140f0b495a1214 (patch) | |
tree | b4c5e3cc7fd2021ee5a4343ea2839890865c3173 /lib/arel | |
parent | 4b91cbc688b2fdc09a4a67a018c6bcb773934ea1 (diff) | |
download | rails-ad16c18cc3a7db4b56611b9244140f0b495a1214.tar.gz rails-ad16c18cc3a7db4b56611b9244140f0b495a1214.tar.bz2 rails-ad16c18cc3a7db4b56611b9244140f0b495a1214.zip |
insert statements supported
Diffstat (limited to 'lib/arel')
-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 |