aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/update_manager.rb
blob: 3af73d2962a9a6264abe7aa3b0d89ac7ae1d5e92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Arel
  class UpdateManager < Arel::TreeManager
    def initialize engine
      super
      @head = Nodes::UpdateStatement.new
    end

    ###
    # UPDATE +table+
    def table table
      @head.relation = table
      self
    end

    def where expr
      @head.wheres << expr
      self
    end
  end
end