mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Don't use regular rinder on calculations since scoping order blows
PostreSQL.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user