diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-10-09 03:12:32 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-10-09 03:12:32 +0000 |
commit | c98b471ca46bb21491649d8ca56052e14a0d1bd7 (patch) | |
tree | b4e02d688279657c95ae81e8bea1f37eb49cf147 /activerecord/lib/active_record | |
parent | 8e3bf70bcd496ae642fdae5ad7717ad8378de176 (diff) | |
download | rails-c98b471ca46bb21491649d8ca56052e14a0d1bd7.tar.gz rails-c98b471ca46bb21491649d8ca56052e14a0d1bd7.tar.bz2 rails-c98b471ca46bb21491649d8ca56052e14a0d1bd7.zip |
Reverted old select_limited_ids_list postgresql fix that caused issues in mysql. Closes #5851 [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5265 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 459484f8c2..6f70830295 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1196,11 +1196,10 @@ module ActiveRecord sql = "SELECT " sql << "DISTINCT #{table_name}." if include_eager_conditions?(options) || include_eager_order?(options) sql << primary_key - sql << ", #{options[:order].split(',').collect { |s| s.split.first } * ', '}" if options[:order] && (include_eager_conditions?(options) || include_eager_order?(options)) sql << " FROM #{table_name} " if include_eager_conditions?(options) || include_eager_order?(options) - sql << join_dependency.join_associations.collect{|join| join.association_join }.join + sql << join_dependency.join_associations.collect(&:association_join).join add_joins!(sql, options, scope) end @@ -1209,7 +1208,7 @@ module ActiveRecord add_limit!(sql, options, scope) return sanitize_sql(sql) end - + # Checks if the conditions reference a table other than the current model table def include_eager_conditions?(options) # look in both sets of conditions diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index a2eaac549e..aa2a6ca71b 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -111,6 +111,10 @@ module ActiveRecord 63 end + def requires_order_columns_in_distinct_clause? # :nodoc: + true + end + # QUOTING ================================================== def quote(value, column = nil) |