Class: Arel::DeleteManager
Instance Attribute Summary
Attributes inherited from TreeManager
#ast
Instance Method Summary
collapse
#key, #key=, #offset, #order, #take, #where, #wheres=
Methods inherited from TreeManager
#initialize_copy, #to_dot, #to_sql
#cast, #coalesce, #create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower
Constructor Details
#initialize(table = nil) ⇒ DeleteManager
7
8
9
|
# File 'lib/arel/delete_manager.rb', line 7
def initialize(table = nil)
@ast = Nodes::DeleteStatement.new(table)
end
|
Instance Method Details
32
33
34
35
|
# File 'lib/arel/delete_manager.rb', line 32
def (value)
@ast. = value
self
end
|
#from(relation) ⇒ Object
11
12
13
14
|
# File 'lib/arel/delete_manager.rb', line 11
def from(relation)
@ast.relation = relation
self
end
|
#group(columns) ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File '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) ⇒ Object
27
28
29
30
|
# File 'lib/arel/delete_manager.rb', line 27
def having(expr)
@ast.havings << expr
self
end
|