123456789_123456789_123456789_123456789_123456789_

Module: Arel::TreeManager::StatementMethods

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: activerecord/lib/arel/tree_manager.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#key (rw)

[ GitHub ]

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

def key
  @ast.key
end

#key=(key) (rw)

[ GitHub ]

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

def key=(key)
  @ast.key = if key.is_a?(Array)
    key.map { |k| Nodes.build_quoted(k) }
  else
    Nodes.build_quoted(key)
  end
end

#wheres=(exprs) (writeonly)

[ GitHub ]

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

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

Instance Method Details

#offset(offset)

[ GitHub ]

  
# 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)

[ GitHub ]

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

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

#take(limit)

[ GitHub ]

  
# 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)

[ GitHub ]

  
# File 'activerecord/lib/arel/tree_manager.rb', line 39

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