diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-14 15:59:55 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-14 15:59:55 -0300 |
commit | 796ec652ade1bfbf074fc1cfd2cd2e7794f494bc (patch) | |
tree | 7a9ed01e40f0f838462f2f95483c65803ae15fd1 | |
parent | 48c1e6d584409d774b184e0f4d2ef28e5b0e9c90 (diff) | |
download | rails-796ec652ade1bfbf074fc1cfd2cd2e7794f494bc.tar.gz rails-796ec652ade1bfbf074fc1cfd2cd2e7794f494bc.tar.bz2 rails-796ec652ade1bfbf074fc1cfd2cd2e7794f494bc.zip |
Don't use regular rinder on calculations since scoping order blows
PostreSQL.
-rw-r--r-- | activerecord/lib/active_record/calculations.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb index ab501dac33..658101d8ee 100644 --- a/activerecord/lib/active_record/calculations.rb +++ b/activerecord/lib/active_record/calculations.rb @@ -146,7 +146,13 @@ module ActiveRecord join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, merged_includes, construct_join(options[:joins], scope)) construct_finder_arel_with_included_associations(options, join_dependency) else - construct_finder_arel(options) + arel_table(options[:from]). + join(construct_join(options[:joins], scope)). + where(construct_conditions(options[:conditions], scope)). + group(construct_group(options[:group], options[:having], scope)). + order(options[:order]). + take(options[:limit]). + skip(options[:offset]) end if options[:group] return execute_grouped_calculation(operation, column_name, options, relation) |