diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-24 18:36:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-24 18:36:59 -0700 |
commit | da958b98ea86a24b1c79cfb0cef7e42d58646ba9 (patch) | |
tree | d6f868e2cb7962c6e5ab95457c6afab9aa5db4fc /lib/arel/visitors | |
parent | 9c4670c6505d462c27a58a84e6b0746e20b98e7f (diff) | |
download | rails-da958b98ea86a24b1c79cfb0cef7e42d58646ba9.tar.gz rails-da958b98ea86a24b1c79cfb0cef7e42d58646ba9.tar.bz2 rails-da958b98ea86a24b1c79cfb0cef7e42d58646ba9.zip |
adding order clauses method to the select manager
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/order_clauses.rb | 9 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/arel/visitors/order_clauses.rb b/lib/arel/visitors/order_clauses.rb new file mode 100644 index 0000000000..9326897f68 --- /dev/null +++ b/lib/arel/visitors/order_clauses.rb @@ -0,0 +1,9 @@ +module Arel + module Visitors + class OrderClauses < Arel::Visitors::ToSql + def visit_Arel_Nodes_SelectStatement o + o.orders.map { |x| visit x } + end + end + end +end diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index a798d888d3..927ecbb0b0 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -126,8 +126,8 @@ module Arel DISPATCH = {} def visit object - send "visit_#{object.class.name.gsub('::', '_')}", object - #send DISPATCH[object.class], object + #send "visit_#{object.class.name.gsub('::', '_')}", object + send DISPATCH[object.class], object end private_instance_methods(false).each do |method| |