diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 05:14:55 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 05:14:55 +0000 |
commit | ef4ac31de3f310c6426a6d9ebc86b4810ac6325b (patch) | |
tree | 6bc6dc2072ad82162968ce699ba80d0cbf2fc4ae /activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | |
parent | 3b6555acd4516167f5ca094eeae50bf5ffc59db9 (diff) | |
download | rails-ef4ac31de3f310c6426a6d9ebc86b4810ac6325b.tar.gz rails-ef4ac31de3f310c6426a6d9ebc86b4810ac6325b.tar.bz2 rails-ef4ac31de3f310c6426a6d9ebc86b4810ac6325b.zip |
PostgreSQL: use a subselect to correctly perform eager finds with :limit and :order. Closes #4668.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5887 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 599d04e593..8a8d956ca8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -287,6 +287,12 @@ module ActiveRecord def distinct(columns, order_by) "DISTINCT #{columns}" end + + # ORDER BY clause for the passed order option. + # PostgreSQL overrides this due to its stricter standards compliance. + def add_order_by_for_association_limiting!(sql, options) + sql << "ORDER BY #{options[:order]}" + end end end end |