From d9347943a22076911155d9a56d9a3ef6e022994b Mon Sep 17 00:00:00 2001 From: Alexander Staubo Date: Tue, 19 Feb 2013 22:28:16 +0100 Subject: Windowing: Calling #rows or #range should assign framing only once. --- lib/arel/visitors/to_sql.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/arel/visitors') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 8a5e1dbf25..8c63070084 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -343,11 +343,13 @@ module Arel end if o.orders.any? + collector << ' ' if o.partitions.any? collector << "ORDER BY " collector = inject_join o.orders, collector, ", " end if o.framing + collector << ' ' if o.partitions.any? or o.orders.any? collector = visit o.framing, collector end -- cgit v1.2.3