diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-08 17:32:44 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-08 17:32:44 -0700 |
commit | 5c9d75db74572567d66561f6fba6c10350c530ff (patch) | |
tree | bf6cb85321bba942fa1be3bf0f09051ca6cda95d /lib/arel/visitors | |
parent | 539572f023da47c47877fe31b58303cc4b7015b5 (diff) | |
download | rails-5c9d75db74572567d66561f6fba6c10350c530ff.tar.gz rails-5c9d75db74572567d66561f6fba6c10350c530ff.tar.bz2 rails-5c9d75db74572567d66561f6fba6c10350c530ff.zip |
adding locking node to the AST
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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 |