Permalink
Browse files

Order should be unique to first in line, not the reverse, duh!

  • Loading branch information...
1 parent 67e28d4 commit 89d14f355feb7771e458a3025421963c8caa428f @metaskills metaskills committed Jan 17, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/arel/visitors/sqlserver.rb
@@ -129,7 +129,7 @@ def visit_Arel_Nodes_SelectStatementWithOutOffset(o, windowed=false)
core = o.cores.first
projections = core.projections
groups = core.groups
- orders = o.orders.reverse.uniq.reverse
+ orders = o.orders.uniq
if windowed
projections = function_select_statement?(o) ? projections : projections.map { |x| projection_without_expression(x) }
elsif eager_limiting_select_statement?(o)
@@ -320,7 +320,7 @@ def rowtable_orders(o)
[table_from_select_statement(o).primary_key.asc]
else
[table_from_select_statement(o).primary_key.asc]
- end.reverse.uniq.reverse
+ end.uniq
end
# TODO: We use this for grouping too, maybe make Grouping objects vs SqlLiteral.

0 comments on commit 89d14f3

Please sign in to comment.