Class: Arel::UpdateManager

### Home Classes Methods

### In Files

- lib/arel/update_manager.rb

### Parent

Arel::TreeManager

### Methods

- ::new
- #key
- #key=
- #order
- #set
- #table
- #take
- #where
- #wheres=

### Files

- History.txt
- MIT-LICENSE.txt

### Class/Module Index

Quicksearch

- Arel
- Arel::AliasPredication
- Arel::Attributes
- Arel::Attributes::Attribute
- Arel::Attributes::Boolean
- Arel::Attributes::Decimal
- Arel::Attributes::Float
- Arel::Attributes::Integer
- Arel::Attributes::String
- Arel::Attributes::Time
- Arel::Attributes::Undefined
- Arel::Collectors
- Arel::Collectors::Bind
- Arel::Collectors::PlainString
- Arel::Collectors::SQLString
- Arel::Crud
- Arel::DeleteManager
- Arel::Expressions
- Arel::FactoryMethods
- Arel::InsertManager
- Arel::Math
- Arel::Nodes
- Arel::Nodes::Addition
- Arel::Nodes::And
- Arel::Nodes::Ascending
- Arel::Nodes::Binary
- Arel::Nodes::BindParam
- Arel::Nodes::Count
- Arel::Nodes::CurrentRow
- Arel::Nodes::DeleteStatement
- Arel::Nodes::Descending
- Arel::Nodes::Distinct
- Arel::Nodes::Division
- Arel::Nodes::DoesNotMatch
- Arel::Nodes::Equality
- Arel::Nodes::Extract
- Arel::Nodes::False
- Arel::Nodes::Following
- Arel::Nodes::FullOuterJoin
- Arel::Nodes::Function
- Arel::Nodes::Grouping
- Arel::Nodes::In
- Arel::Nodes::InfixOperation
- Arel::Nodes::InnerJoin
- Arel::Nodes::InsertStatement
- Arel::Nodes::JoinSource
- Arel::Nodes::Matches
- Arel::Nodes::Multiplication
- Arel::Nodes::NamedFunction
- Arel::Nodes::NamedWindow
- Arel::Nodes::Node
- Arel::Nodes::OuterJoin
- Arel::Nodes::Over
- Arel::Nodes::Preceding
- Arel::Nodes::Range
- Arel::Nodes::RightOuterJoin
- Arel::Nodes::Rows
- Arel::Nodes::SelectCore
- Arel::Nodes::SelectStatement
- Arel::Nodes::SqlLiteral
- Arel::Nodes::StringJoin
- Arel::Nodes::Subtraction
- Arel::Nodes::TableAlias
- Arel::Nodes::True
- Arel::Nodes::Unary
- Arel::Nodes::UnqualifiedColumn
- Arel::Nodes::UpdateStatement
- Arel::Nodes::Values
- Arel::Nodes::Window
- Arel::Nodes::With
- Arel::Nodes::WithRecursive
- Arel::OrderPredications
- Arel::Predications
- Arel::SelectManager
- Arel::Table
- Arel::TreeManager
- Arel::UpdateManager
- Arel::Visitors
- Arel::Visitors::BindSubstitute
- Arel::Visitors::BindVisitor
- Arel::Visitors::DepthFirst
- Arel::Visitors::Dot
- Arel::Visitors::IBM_DB
- Arel::Visitors::Informix
- Arel::Visitors::MSSQL
- Arel::Visitors::MySQL
- Arel::Visitors::Oracle
- Arel::Visitors::PostgreSQL
- Arel::Visitors::Reduce
- Arel::Visitors::SQLite
- Arel::Visitors::ToSql
- Arel::Visitors::Visitor
- Arel::Visitors::WhereSql
- Arel::WindowPredications

No matching classes.

# Arel::UpdateManager

### Public Class Methods

new(engine) click to toggle source

    # File lib/arel/update_manager.rb, line 3
    def initialize engine
      super
      @ast = Nodes::UpdateStatement.new
      @ctx = @ast
    end

### Public Instance Methods

key() click to toggle source

    # File lib/arel/update_manager.rb, line 18
    def key
      @ast.key
    end

key=(key) click to toggle source

    # File lib/arel/update_manager.rb, line 14
    def key= key
      @ast.key = Nodes.build_quoted(key)
    end

order(*expr) click to toggle source

    # File lib/arel/update_manager.rb, line 22
    def order *expr
      @ast.orders = expr
      self
    end

set(values) click to toggle source

    # File lib/arel/update_manager.rb, line 43
    def set values
      if String === values
        @ast.values = [values]
      else
        @ast.values = values.map { |column,value|
          Nodes::Assignment.new(
            Nodes::UnqualifiedColumn.new(column),
            value
          )
        }
      end
      self
    end

table(table) click to toggle source

UPDATE `table`

    # File lib/arel/update_manager.rb, line 29
    def table table
      @ast.relation = table
      self
    end

take(limit) click to toggle source

    # File lib/arel/update_manager.rb, line 9
    def take limit
      @ast.limit = Nodes::Limit.new(Nodes.build_quoted(limit)) if limit
      self
    end

where(expr) click to toggle source

    # File lib/arel/update_manager.rb, line 38
    def where expr
      @ast.wheres << expr
      self
    end

wheres=(exprs) click to toggle source

    # File lib/arel/update_manager.rb, line 34
    def wheres= exprs
      @ast.wheres = exprs
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.