1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel/nodes/insert_statement.rb

38 lines
855 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-02-24 01:45:50 -05:00
2018-02-24 02:41:47 -05:00
module Arel # :nodoc: all
module Nodes
2010-11-29 17:30:06 -05:00
class InsertStatement < Arel::Nodes::Node
attr_accessor :relation, :columns, :values, :select
def initialize
2013-05-17 18:43:54 -04:00
super()
@relation = nil
@columns = []
@values = nil
@select = nil
end
2010-08-16 23:59:18 -04:00
2018-02-24 01:45:50 -05:00
def initialize_copy(other)
2010-08-16 23:59:18 -04:00
super
@columns = @columns.clone
@values = @values.clone if @values
@select = @select.clone if @select
2010-08-16 23:59:18 -04:00
end
def hash
[@relation, @columns, @values, @select].hash
end
2018-02-24 01:45:50 -05:00
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?
end
end
end