提交 d7ff05e2 编写于 作者: A Aaron Patterson

Merge branch '2-0-stable'

* 2-0-stable:
  making sure limit is correctly copied to update manager
......@@ -12,7 +12,7 @@ def compile_update values
end
um.table relation
um.set values
um.take @ast.limit
um.take @ast.limit.expr if @ast.limit
um.order(*@ast.orders)
um.wheres = @ctx.wheres
um
......
......@@ -7,7 +7,7 @@ def initialize engine
end
def take limit
@ast.limit = limit
@ast.limit = Nodes::Limit.new(limit) if limit
self
end
......
......@@ -8,6 +8,15 @@ module Arel
end
end
it 'handles limit properly' do
table = Table.new(:users)
um = Arel::UpdateManager.new Table.engine
um.take 10
um.table table
um.set [[table[:name], nil]]
assert_match(/LIMIT 10/, um.to_sql)
end
describe 'set' do
it "updates with null" do
table = Table.new(:users)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册