Permalink
Browse files

Rename CalculationMethods to Calculations and get rid of the old Calc…

…ulations module
  • Loading branch information...
lifo committed Jan 19, 2010
1 parent 8f63dcb commit 9465b84b543ae1ada29c0e39e34f919c724eab6d
@@ -53,14 +53,13 @@ module ActiveRecord
autoload_under 'relation' do
autoload :QueryMethods
autoload :FinderMethods
- autoload :CalculationMethods
+ autoload :Calculations
autoload :PredicateBuilder
autoload :SpawnMethods
end
autoload :Base
autoload :Batches
- autoload :Calculations
autoload :Callbacks
autoload :DynamicFinderMatch
autoload :DynamicScopeMatch
@@ -654,6 +654,7 @@ def find(*args)
end
delegate :select, :group, :order, :limit, :joins, :where, :preload, :eager_load, :includes, :from, :lock, :readonly, :having, :to => :scoped
+ delegate :count, :average, :minimum, :maximum, :sum, :calculate, :to => :scoped
# A convenience wrapper for <tt>find(:first, *args)</tt>. You can pass in all the
# same arguments to this method as you can to <tt>find(:first)</tt>.
@@ -2742,7 +2743,7 @@ def quoted_comma_pair_list(quoter, hash)
# #save_with_autosave_associations to be wrapped inside a transaction.
include AutosaveAssociation, NestedAttributes
- include Aggregations, Transactions, Reflection, Batches, Calculations, Serialization
+ include Aggregations, Transactions, Reflection, Batches, Serialization
end
end
@@ -1,9 +0,0 @@
-module ActiveRecord
- module Calculations #:nodoc:
- extend ActiveSupport::Concern
-
- module ClassMethods
- delegate :count, :average, :minimum, :maximum, :sum, :calculate, :to => :scoped
- end
- end
-end
@@ -5,7 +5,7 @@ class Relation
MULTI_VALUE_METHODS = [:select, :group, :order, :joins, :where, :having]
SINGLE_VALUE_METHODS = [:limit, :offset, :lock, :readonly, :create_with, :from]
- include FinderMethods, CalculationMethods, SpawnMethods, QueryMethods
+ include FinderMethods, Calculations, SpawnMethods, QueryMethods
delegate :length, :collect, :map, :each, :all?, :include?, :to => :to_a
@@ -1,5 +1,5 @@
module ActiveRecord
- module CalculationMethods
+ module Calculations
# Count operates using three different approaches.
#
# * Count all: By not passing any parameters to count, it will return a count of all the rows for the model.

0 comments on commit 9465b84

Please sign in to comment.