123456789_123456789_123456789_123456789_123456789_

Class: Arel::DeleteManager

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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(table = nil) ⇒ DeleteManager

[ GitHub ]

  
# File 'activerecord/lib/arel/delete_manager.rb', line 7

def initialize(table = nil)
  @ast = Nodes::DeleteStatement.new(table)
end

Instance Method Details

#from(relation)

[ GitHub ]

  
# File 'activerecord/lib/arel/delete_manager.rb', line 11

def from(relation)
  @ast.relation = relation
  self
end

#group(columns)

[ GitHub ]

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

def group(columns)
  columns.each do |column|
    column = Nodes::SqlLiteral.new(column) if String === column
    column = Nodes::SqlLiteral.new(column.to_s) if Symbol === column

    @ast.groups.push Nodes::Group.new column
  end

  self
end

#having(expr)

[ GitHub ]

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

def having(expr)
  @ast.havings << expr
  self
end