Permalink
Browse files

Removed blank lines, rename query to subquery.

  • Loading branch information...
miloops committed Feb 16, 2010
1 parent bfc8bdf commit e4d6689f14960a6faf2aa6d6e1f7220e30eff549
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/arel/engines/sql/compilers/postgresql_compiler.rb
@@ -4,8 +4,7 @@ class PostgreSQLCompiler < GenericCompiler
def select_sql
if !orders.blank? && using_distinct_on?
-
- query = build_query \
+ subquery = build_query \
"SELECT #{select_clauses.kind_of?(::Array) ? select_clauses.join("") : select_clauses.to_s}",
"FROM #{from_clauses}",
(joins(self) unless joins(self).blank? ),
@@ -15,11 +14,10 @@ def select_sql
("#{locked}" unless locked.blank? )
build_query \
- "SELECT * FROM (#{query}) AS id_list",
+ "SELECT * FROM (#{subquery}) AS id_list",
"ORDER BY #{aliased_orders(order_clauses)}",
("LIMIT #{taken}" unless taken.blank? ),
("OFFSET #{skipped}" unless skipped.blank? )
-
else
super
end

0 comments on commit e4d6689

Please sign in to comment.