aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-18 23:39:19 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-18 23:40:42 +0530
commit9e7ec2a9f13aa52cdf07cf9308e8031548dcddc0 (patch)
treebd8e438ff20486cccb23f96fc6c37e044b07132d /activerecord/lib/active_record
parent3c4186b366a14042a6ea6cc3432634d41986d1e2 (diff)
downloadrails-9e7ec2a9f13aa52cdf07cf9308e8031548dcddc0.tar.gz
rails-9e7ec2a9f13aa52cdf07cf9308e8031548dcddc0.tar.bz2
rails-9e7ec2a9f13aa52cdf07cf9308e8031548dcddc0.zip
Simplify calculation scope building. Remove :order from associations as it is troublesome w/ calculation methods using postgresql.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/calculations.rb15
1 files changed, 1 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
index f279bdfc8d..8a44dc7df1 100644
--- a/activerecord/lib/active_record/calculations.rb
+++ b/activerecord/lib/active_record/calculations.rb
@@ -164,20 +164,7 @@ module ActiveRecord
join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, includes, construct_join(joins))
construct_finder_arel_with_included_associations(options, join_dependency)
else
- relation = unscoped.apply_finder_options(options.slice(:joins, :conditions, :order, :limit, :offset, :group, :having))
-
- if current_scoped_methods
- relation = current_scoped_methods.except(:select, :order, :limit, :offset, :group, :from).merge(relation)
- end
-
- from = current_scoped_methods.from_value if current_scoped_methods && current_scoped_methods.from_value.present?
- from = options[:from] if from.blank? && options[:from].present?
- relation = relation.from(from)
-
- select = options[:select].presence || (current_scoped_methods ? current_scoped_methods.select_values.join(", ") : nil)
- relation = relation.select(select)
-
- relation
+ scoped.apply_finder_options(options)
end
end