1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #77 from ebeigarts/master

Support locking in Oracle
This commit is contained in:
Aaron Patterson 2011-08-26 08:48:09 -07:00
commit 2aac990e4d
2 changed files with 11 additions and 0 deletions

View file

@ -3,6 +3,10 @@ module Arel
class Oracle < Arel::Visitors::ToSql
private
def visit_Arel_Nodes_Lock o
visit o.expr
end
def visit_Arel_Nodes_SelectStatement o
o = order_hacks(o)

View file

@ -143,6 +143,13 @@ module Arel
( SELECT * FROM users WHERE age > 10 MINUS SELECT * FROM users WHERE age > 20 )
}
end
describe 'locking' do
it 'defaults to FOR UPDATE when locking' do
node = Nodes::Lock.new(Arel.sql('FOR UPDATE'))
@visitor.accept(node).must_be_like "FOR UPDATE"
end
end
end
end
end