Class: Arel::Nodes::OnConflict

Inherits:
Node
  • Object
show all
Defined in:
lib/active_record_upsert/arel/nodes/on_conflict.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOnConflict

Returns a new instance of OnConflict.



6
7
8
9
10
# File 'lib/active_record_upsert/arel/nodes/on_conflict.rb', line 6

def initialize
  super
  @target = nil
  @action = nil
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



4
5
6
# File 'lib/active_record_upsert/arel/nodes/on_conflict.rb', line 4

def action
  @action
end

#targetObject

Returns the value of attribute target.



4
5
6
# File 'lib/active_record_upsert/arel/nodes/on_conflict.rb', line 4

def target
  @target
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/active_record_upsert/arel/nodes/on_conflict.rb', line 16

def eql? other
  self.class == other.class &&
    self.target == other.target &&
    self.update_statement == other.update_statement
end

#hashObject



12
13
14
# File 'lib/active_record_upsert/arel/nodes/on_conflict.rb', line 12

def hash
  [@target, @action].hash
end