From 481ccefedd407c1f8941596b03e72cfe35c42d41 Mon Sep 17 00:00:00 2001 From: Edgars Beigarts Date: Fri, 26 Aug 2011 20:01:00 +0300 Subject: Support locking by default and disable it only for SQLite. --- test/test_select_manager.rb | 2 +- test/visitors/test_sqlite.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 6603102a3a..7e9099d0d0 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -454,7 +454,7 @@ module Arel it 'adds a lock node' do table = Table.new :users mgr = table.from table - mgr.lock.to_sql.must_be_like %{ SELECT FROM "users" } + mgr.lock.to_sql.must_be_like %{ SELECT FROM "users" FOR UPDATE } end end diff --git a/test/visitors/test_sqlite.rb b/test/visitors/test_sqlite.rb index 5b81ea90c5..c06f554ea4 100644 --- a/test/visitors/test_sqlite.rb +++ b/test/visitors/test_sqlite.rb @@ -13,6 +13,11 @@ module Arel sql = @visitor.accept(stmt) sql.must_be_like "SELECT LIMIT -1 OFFSET 1" end + + it 'does not support locking' do + node = Nodes::Lock.new(Arel.sql('FOR UPDATE')) + @visitor.accept(node).must_be_nil + end end end end -- cgit v1.2.3