Module: Arel::TreeManager::StatementMethods

Included in:
DeleteManager, UpdateManager
Defined in:
activerecord/lib/arel/tree_manager.rb

Instance Method Summary collapse

Instance Method Details

#keyObject



27
28
29
# File 'activerecord/lib/arel/tree_manager.rb', line 27

def key
  @ast.key
end

#key=(key) ⇒ Object



23
24
25
# File 'activerecord/lib/arel/tree_manager.rb', line 23

def key=(key)
  @ast.key = Nodes.build_quoted(key)
end

#offset(offset) ⇒ Object



13
14
15
16
# File 'activerecord/lib/arel/tree_manager.rb', line 13

def offset(offset)
  @ast.offset = Nodes::Offset.new(Nodes.build_quoted(offset)) if offset
  self
end

#order(*expr) ⇒ Object



18
19
20
21
# File 'activerecord/lib/arel/tree_manager.rb', line 18

def order(*expr)
  @ast.orders = expr
  self
end

#take(limit) ⇒ Object



8
9
10
11
# File 'activerecord/lib/arel/tree_manager.rb', line 8

def take(limit)
  @ast.limit = Nodes::Limit.new(Nodes.build_quoted(limit)) if limit
  self
end

#where(expr) ⇒ Object



35
36
37
38
# File 'activerecord/lib/arel/tree_manager.rb', line 35

def where(expr)
  @ast.wheres << expr
  self
end

#wheres=(exprs) ⇒ Object



31
32
33
# File 'activerecord/lib/arel/tree_manager.rb', line 31

def wheres=(exprs)
  @ast.wheres = exprs
end