aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-19 22:15:35 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-19 22:17:33 +0530
commit9465b84b543ae1ada29c0e39e34f919c724eab6d (patch)
tree1b707bff64d740cd300061e9e3f75557a3dc83a4 /activerecord
parent8f63dcb64873fe94c5d837a49f742d41589ce311 (diff)
downloadrails-9465b84b543ae1ada29c0e39e34f919c724eab6d.tar.gz
rails-9465b84b543ae1ada29c0e39e34f919c724eab6d.tar.bz2
rails-9465b84b543ae1ada29c0e39e34f919c724eab6d.zip
Rename CalculationMethods to Calculations and get rid of the old Calculations module
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record.rb3
-rwxr-xr-xactiverecord/lib/active_record/base.rb3
-rw-r--r--activerecord/lib/active_record/calculations.rb9
-rw-r--r--activerecord/lib/active_record/relation.rb2
-rw-r--r--activerecord/lib/active_record/relation/calculations.rb (renamed from activerecord/lib/active_record/relation/calculation_methods.rb)2
5 files changed, 5 insertions, 14 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index d5b6d40514..58673ab7bd 100644
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
@@ -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
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 06244d1132..e10df1abd3 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -654,6 +654,7 @@ module ActiveRecord #:nodoc:
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 @@ module ActiveRecord #:nodoc:
# #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
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
deleted file mode 100644
index ea63617c52..0000000000
--- a/activerecord/lib/active_record/calculations.rb
+++ /dev/null
@@ -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
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index 19f91f4278..6ac7137976 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -5,7 +5,7 @@ module ActiveRecord
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
diff --git a/activerecord/lib/active_record/relation/calculation_methods.rb b/activerecord/lib/active_record/relation/calculations.rb
index 155e90333c..5645e7f031 100644
--- a/activerecord/lib/active_record/relation/calculation_methods.rb
+++ b/activerecord/lib/active_record/relation/calculations.rb
@@ -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.