aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-05-28 11:35:36 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-28 11:35:36 -0500
commit4e50a35fa243f6cf7ad567774a9f7c1cb87a1653 (patch)
tree6bfb95c899c61b10406a03f8e9a6211b93fecd6b /activerecord
parentde203245afd2bbf7f93f3241fcf3a71a88101d47 (diff)
downloadrails-4e50a35fa243f6cf7ad567774a9f7c1cb87a1653.tar.gz
rails-4e50a35fa243f6cf7ad567774a9f7c1cb87a1653.tar.bz2
rails-4e50a35fa243f6cf7ad567774a9f7c1cb87a1653.zip
Break up DependencyModule's dual function of providing a "depend_on" DSL and "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/aggregations.rb2
-rw-r--r--activerecord/lib/active_record/association_preload.rb2
-rwxr-xr-xactiverecord/lib/active_record/associations.rb2
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb2
-rw-r--r--activerecord/lib/active_record/autosave_association.rb2
-rw-r--r--activerecord/lib/active_record/batches.rb2
-rw-r--r--activerecord/lib/active_record/calculations.rb2
-rw-r--r--activerecord/lib/active_record/callbacks.rb2
-rw-r--r--activerecord/lib/active_record/dirty.rb2
-rw-r--r--activerecord/lib/active_record/fixtures.rb2
-rw-r--r--activerecord/lib/active_record/locking/optimistic.rb2
-rw-r--r--activerecord/lib/active_record/named_scope.rb2
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb2
-rw-r--r--activerecord/lib/active_record/observer.rb2
-rw-r--r--activerecord/lib/active_record/reflection.rb2
-rw-r--r--activerecord/lib/active_record/serializers/json_serializer.rb2
-rw-r--r--activerecord/lib/active_record/timestamp.rb2
-rw-r--r--activerecord/lib/active_record/transactions.rb2
-rw-r--r--activerecord/lib/active_record/validations.rb2
-rw-r--r--activerecord/test/cases/associations/eager_load_nested_include_test.rb2
-rw-r--r--activerecord/test/cases/repair_helper.rb2
21 files changed, 21 insertions, 21 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index 359e70f5ed..9ecf231a66 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -1,6 +1,6 @@
module ActiveRecord
module Aggregations # :nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
def clear_aggregation_cache #:nodoc:
self.class.reflect_on_all_aggregations.to_a.each do |assoc|
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb
index 5df76bb183..af80a579d6 100644
--- a/activerecord/lib/active_record/association_preload.rb
+++ b/activerecord/lib/active_record/association_preload.rb
@@ -1,7 +1,7 @@
module ActiveRecord
# See ActiveRecord::AssociationPreload::ClassMethods for documentation.
module AssociationPreload #:nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
# Implements the details of eager loading of ActiveRecord associations.
# Application developers should not use this module directly.
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 76726b7845..157716a477 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -79,7 +79,7 @@ module ActiveRecord
# See ActiveRecord::Associations::ClassMethods for documentation.
module Associations # :nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
# These classes will be loaded when associations are created.
# So there is no need to eager load them.
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index d5e215af9d..15358979c2 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -2,7 +2,7 @@ require 'active_support/core_ext/enumerable'
module ActiveRecord
module AttributeMethods #:nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
DEFAULT_SUFFIXES = %w(= ? _before_type_cast)
ATTRIBUTE_TYPES_CACHED_BY_DEFAULT = [:datetime, :timestamp, :time, :date]
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index 4ab2818282..ef9c40ed4d 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -125,7 +125,7 @@ module ActiveRecord
# post.author.name = ''
# post.save(false) # => true
module AutosaveAssociation
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
ASSOCIATION_TYPES = %w{ has_one belongs_to has_many has_and_belongs_to_many }
diff --git a/activerecord/lib/active_record/batches.rb b/activerecord/lib/active_record/batches.rb
index 4836601297..e41d38fb8f 100644
--- a/activerecord/lib/active_record/batches.rb
+++ b/activerecord/lib/active_record/batches.rb
@@ -1,6 +1,6 @@
module ActiveRecord
module Batches # :nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
# When processing large numbers of records, it's often a good idea to do
# so in batches to prevent memory ballooning.
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
index 7afa7c49bd..727f4c1dc6 100644
--- a/activerecord/lib/active_record/calculations.rb
+++ b/activerecord/lib/active_record/calculations.rb
@@ -1,6 +1,6 @@
module ActiveRecord
module Calculations #:nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
CALCULATIONS_OPTIONS = [:conditions, :joins, :order, :select, :group, :having, :distinct, :limit, :offset, :include, :from]
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
index a77fdb1c13..36f5f2ce47 100644
--- a/activerecord/lib/active_record/callbacks.rb
+++ b/activerecord/lib/active_record/callbacks.rb
@@ -211,7 +211,7 @@ module ActiveRecord
# needs to be aware of it because an ordinary +save+ will raise such exception
# instead of quietly returning +false+.
module Callbacks
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
CALLBACKS = %w(
after_find after_initialize before_save after_save before_create after_create before_update after_update before_validation
diff --git a/activerecord/lib/active_record/dirty.rb b/activerecord/lib/active_record/dirty.rb
index ac84f6b209..178767e0c3 100644
--- a/activerecord/lib/active_record/dirty.rb
+++ b/activerecord/lib/active_record/dirty.rb
@@ -34,7 +34,7 @@ module ActiveRecord
# person.name << 'by'
# person.name_change # => ['uncle bob', 'uncle bobby']
module Dirty
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
DIRTY_SUFFIXES = ['_changed?', '_change', '_will_change!', '_was']
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 721114d9d0..2b0cfc2c3b 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -807,7 +807,7 @@ end
module ActiveRecord
module TestFixtures
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
setup :setup_fixtures
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb
index cf4f8864c6..cec5ca3324 100644
--- a/activerecord/lib/active_record/locking/optimistic.rb
+++ b/activerecord/lib/active_record/locking/optimistic.rb
@@ -42,7 +42,7 @@ module ActiveRecord
# To override the name of the lock_version column, invoke the <tt>set_locking_column</tt> method.
# This method uses the same syntax as <tt>set_table_name</tt>
module Optimistic
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
cattr_accessor :lock_optimistically, :instance_writer => false
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb
index e7151a3d47..1b22fa5e24 100644
--- a/activerecord/lib/active_record/named_scope.rb
+++ b/activerecord/lib/active_record/named_scope.rb
@@ -3,7 +3,7 @@ require 'active_support/core_ext/hash/except'
module ActiveRecord
module NamedScope
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
# All subclasses of ActiveRecord::Base have one named scope:
# * <tt>scoped</tt> - which allows for the creation of anonymous \scopes, on the fly: <tt>Shirt.scoped(:conditions => {:color => 'red'}).scoped(:include => :washing_instructions)</tt>
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index c532d3dfa3..0beb4321a2 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -3,7 +3,7 @@ require 'active_support/core_ext/object/try'
module ActiveRecord
module NestedAttributes #:nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
class_inheritable_accessor :reject_new_nested_attributes_procs, :instance_writer => false
diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb
index 1ca76c7b2f..89ec0962bf 100644
--- a/activerecord/lib/active_record/observer.rb
+++ b/activerecord/lib/active_record/observer.rb
@@ -3,7 +3,7 @@ require 'set'
module ActiveRecord
module Observing # :nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
module ClassMethods
# Activates the observers assigned. Examples:
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 3747ba449d..0baa9654b7 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -1,6 +1,6 @@
module ActiveRecord
module Reflection # :nodoc:
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
# Reflection allows you to interrogate Active Record classes and objects about their associations and aggregations.
# This information can, for example, be used in a form builder that took an Active Record object and created input
diff --git a/activerecord/lib/active_record/serializers/json_serializer.rb b/activerecord/lib/active_record/serializers/json_serializer.rb
index d376fd5e1b..67e2b2abb3 100644
--- a/activerecord/lib/active_record/serializers/json_serializer.rb
+++ b/activerecord/lib/active_record/serializers/json_serializer.rb
@@ -2,7 +2,7 @@ require 'active_support/json'
module ActiveRecord #:nodoc:
module Serialization
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
cattr_accessor :include_root_in_json, :instance_writer => false
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb
index 3734e170af..da075dabd3 100644
--- a/activerecord/lib/active_record/timestamp.rb
+++ b/activerecord/lib/active_record/timestamp.rb
@@ -8,7 +8,7 @@ module ActiveRecord
# Timestamps are in the local timezone by default but you can use UTC by setting
# <tt>ActiveRecord::Base.default_timezone = :utc</tt>
module Timestamp
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
alias_method_chain :create, :timestamps
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 471a81dfb5..4f8ccdd40e 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -3,7 +3,7 @@ require 'thread'
module ActiveRecord
# See ActiveRecord::Transactions::ClassMethods for documentation.
module Transactions
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
class TransactionError < ActiveRecordError # :nodoc:
end
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index a18fb3f426..efc59908cf 100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -302,7 +302,7 @@ module ActiveRecord
#
# An Errors object is automatically created for every Active Record.
module Validations
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
VALIDATIONS = %w( validate validate_on_create validate_on_update )
diff --git a/activerecord/test/cases/associations/eager_load_nested_include_test.rb b/activerecord/test/cases/associations/eager_load_nested_include_test.rb
index cb7fe9698b..f313a75233 100644
--- a/activerecord/test/cases/associations/eager_load_nested_include_test.rb
+++ b/activerecord/test/cases/associations/eager_load_nested_include_test.rb
@@ -7,7 +7,7 @@ require 'models/categorization'
require 'active_support/core_ext/array/random_access'
module Remembered
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
after_create :remember
diff --git a/activerecord/test/cases/repair_helper.rb b/activerecord/test/cases/repair_helper.rb
index 686bfee46d..80d04010d6 100644
--- a/activerecord/test/cases/repair_helper.rb
+++ b/activerecord/test/cases/repair_helper.rb
@@ -1,7 +1,7 @@
module ActiveRecord
module Testing
module RepairHelper
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
module Toolbox
def self.record_validations(*model_classes)