diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-10 11:14:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-10 11:14:23 -0700 |
commit | 048478bf152a495a2d0ba17990d6966970a38cff (patch) | |
tree | ae4bc31be51f32c22f9225509d1cdfd8d5e7bd63 /lib/arel/nodes/insert_statement.rb | |
parent | 4b187a19b16ed4cb0b248e4e4d658a4ef6e8f26e (diff) | |
parent | 4a898b3c682f74890065e28ffe03899f23a4ab20 (diff) | |
download | rails-048478bf152a495a2d0ba17990d6966970a38cff.tar.gz rails-048478bf152a495a2d0ba17990d6966970a38cff.tar.bz2 rails-048478bf152a495a2d0ba17990d6966970a38cff.zip |
Merge pull request #255 from byroot/insert-select
Allow INSERT INTO <table> SELECT queries
Diffstat (limited to 'lib/arel/nodes/insert_statement.rb')
-rw-r--r-- | lib/arel/nodes/insert_statement.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/arel/nodes/insert_statement.rb b/lib/arel/nodes/insert_statement.rb index ec8870a1c2..ada4fcc562 100644 --- a/lib/arel/nodes/insert_statement.rb +++ b/lib/arel/nodes/insert_statement.rb @@ -1,29 +1,32 @@ module Arel module Nodes class InsertStatement < Arel::Nodes::Node - attr_accessor :relation, :columns, :values + attr_accessor :relation, :columns, :values, :select def initialize super() @relation = nil @columns = [] @values = nil + @select = nil end def initialize_copy other super @columns = @columns.clone @values = @values.clone if @values + @select = @select.clone if @select end def hash - [@relation, @columns, @values].hash + [@relation, @columns, @values, @select].hash end def eql? other self.class == other.class && self.relation == other.relation && self.columns == other.columns && + self.select == other.select && self.values == other.values end alias :== :eql? |