diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-02-16 10:11:14 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-02-16 10:11:14 -0300 |
commit | e4d6689f14960a6faf2aa6d6e1f7220e30eff549 (patch) | |
tree | af8e4e56168ae1d290f87258c7dff0f9b27e9c6f | |
parent | bfc8bdf667cf22395938c206f44ab089b4873347 (diff) | |
download | rails-e4d6689f14960a6faf2aa6d6e1f7220e30eff549.tar.gz rails-e4d6689f14960a6faf2aa6d6e1f7220e30eff549.tar.bz2 rails-e4d6689f14960a6faf2aa6d6e1f7220e30eff549.zip |
Removed blank lines, rename query to subquery.
-rw-r--r-- | lib/arel/engines/sql/compilers/postgresql_compiler.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/arel/engines/sql/compilers/postgresql_compiler.rb b/lib/arel/engines/sql/compilers/postgresql_compiler.rb index 809485bb4d..4122bc730e 100644 --- a/lib/arel/engines/sql/compilers/postgresql_compiler.rb +++ b/lib/arel/engines/sql/compilers/postgresql_compiler.rb @@ -4,8 +4,7 @@ module Arel 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 @@ module Arel ("#{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 |