Skip to content

Commit

Permalink
Don't scope order in calculations.'
Browse files Browse the repository at this point in the history
  • Loading branch information
miloops committed Aug 7, 2009
1 parent 04abe53 commit 6b5fab9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/calculations.rb
Expand Up @@ -155,7 +155,7 @@ def calculate(operation, column_name, options = {})
relation.where(construct_conditions(options[:conditions], scope)) relation.where(construct_conditions(options[:conditions], scope))
relation.where(construct_arel_limited_ids_condition(options, join_dependency)) if join_dependency && !using_limitable_reflections?(join_dependency.reflections) && ((scope && scope[:limit]) || options[:limit]) relation.where(construct_arel_limited_ids_condition(options, join_dependency)) if join_dependency && !using_limitable_reflections?(join_dependency.reflections) && ((scope && scope[:limit]) || options[:limit])


relation.order(construct_order(options[:order], scope)) relation.order(options[:order])
relation.take(options[:limit]) relation.take(options[:limit])
relation.skip(options[:offset]) relation.skip(options[:offset])


Expand Down

0 comments on commit 6b5fab9

Please sign in to comment.