123456789_123456789_123456789_123456789_123456789_

Class: Arel::Nodes::InsertStatement

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Node
Instance Chain:
Inherits: Arel::Nodes::Node
Defined in: activerecord/lib/arel/nodes/insert_statement.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Node - Inherited

#and

Factory method to create an And node.

#fetch_attribute, #invert,
#not

Factory method to create a Nodes::Not node that has the recipient of the caller as a child.

#or

Factory method to create a Grouping node that has an Or node as a child.

#to_sql

FIXME: this method should go away.

::Arel::FactoryMethods - Included

Constructor Details

.new(relation = nil) ⇒ InsertStatement

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 8

def initialize(relation = nil)
  super()
  @relation = relation
  @columns  = []
  @values   = nil
  @select   = nil
end

Instance Attribute Details

#columns (rw)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 6

attr_accessor :relation, :columns, :values, :select

#relation (rw)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 6

attr_accessor :relation, :columns, :values, :select

#select (rw)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 6

attr_accessor :relation, :columns, :values, :select

#values (rw)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 6

attr_accessor :relation, :columns, :values, :select

Instance Method Details

#==(other)

Alias for #eql?.

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 34

alias :== :eql?

#eql?(other) ⇒ Boolean Also known as: #==

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 27

def eql?(other)
  self.class == other.class &&
    self.relation == other.relation &&
    self.columns == other.columns &&
    self.select == other.select &&
    self.values == other.values
end

#hash

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 23

def hash
  [@relation, @columns, @values, @select].hash
end

#initialize_copy(other)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/insert_statement.rb', line 16

def initialize_copy(other)
  super
  @columns = @columns.clone
  @values =  @values.clone if @values
  @select =  @select.clone if @select
end