Skip to content

Commit

Permalink
Rename CalculationMethods to Calculations and get rid of the old Calc…
Browse files Browse the repository at this point in the history
…ulations module
  • Loading branch information
lifo committed Jan 19, 2010
1 parent 8f63dcb commit 9465b84
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions activerecord/lib/active_record.rb
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -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>.
Expand Down Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions activerecord/lib/active_record/calculations.rb

This file was deleted.

2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation.rb
Expand Up @@ -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

Expand Down
@@ -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.
Expand Down

0 comments on commit 9465b84

Please sign in to comment.