From 5c9d75db74572567d66561f6fba6c10350c530ff Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 8 Sep 2010 17:32:44 -0700 Subject: adding locking node to the AST --- lib/arel/visitors/to_sql.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/arel/visitors') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 12967d27ad..0f2de092ea 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -48,7 +48,8 @@ module Arel [ o.cores.map { |x| visit x }.join, ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), - ("LIMIT #{o.limit}" if o.limit) + ("LIMIT #{o.limit}" if o.limit), + (visit(o.lock) if o.lock), ].compact.join ' ' end @@ -66,6 +67,11 @@ module Arel "HAVING #{visit o.expr}" end + # FIXME: this does nothing on SQLLite3, but should do things on other + # databases. + def visit_Arel_Nodes_Lock o + end + def visit_Arel_Nodes_Group o visit o.expr end -- cgit v1.2.3