diff options
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| |