aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/crud.rb
blob: 7f78acef84a41f16c81a67a8b5c1a6d44a4cdb03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Arel
  ###
  # FIXME hopefully we can remove this
  module Crud
    # FIXME: this method should go away
    def update values
      um = UpdateManager.new @engine

      if String === values
        um.table @ctx.froms.last
      else
        um.table values.first.first.relation
      end
      um.set values
      um.wheres = @ctx.wheres
      @engine.connection.execute um.to_sql
    end

    # FIXME: this method should go away
    def insert values
      im = InsertManager.new @engine
      im.insert values
      @engine.connection.execute im.to_sql
    end
  end
end