diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-11-24 11:14:24 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-11-24 11:14:24 -0600 |
commit | 7254d23764f7abe8023f3daeb07d99ea1c8e777a (patch) | |
tree | 4c1981119e1da9b9c98e8e2d9cf8a3b7dcfcb887 /activerecord/lib/active_record/associations.rb | |
parent | 426a86ab1e4fc2488215a9adab4511a59646a413 (diff) | |
download | rails-7254d23764f7abe8023f3daeb07d99ea1c8e777a.tar.gz rails-7254d23764f7abe8023f3daeb07d99ea1c8e777a.tar.bz2 rails-7254d23764f7abe8023f3daeb07d99ea1c8e777a.zip |
Autoload ActiveRecord files
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 7f7819115c..63e28a43ab 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1,13 +1,3 @@ -require 'active_record/associations/association_proxy' -require 'active_record/associations/association_collection' -require 'active_record/associations/belongs_to_association' -require 'active_record/associations/belongs_to_polymorphic_association' -require 'active_record/associations/has_one_association' -require 'active_record/associations/has_many_association' -require 'active_record/associations/has_many_through_association' -require 'active_record/associations/has_and_belongs_to_many_association' -require 'active_record/associations/has_one_through_association' - module ActiveRecord class HasManyThroughAssociationNotFoundError < ActiveRecordError #:nodoc: def initialize(owner_class_name, reflection) @@ -75,6 +65,18 @@ module ActiveRecord # See ActiveRecord::Associations::ClassMethods for documentation. module Associations # :nodoc: + # These classes will be loaded when associatoins are created. + # So there is no need to eager load them. + autoload :AssociationCollection, 'active_record/associations/association_collection' + autoload :AssociationProxy, 'active_record/associations/association_proxy' + autoload :BelongsToAssociation, 'active_record/associations/belongs_to_association' + autoload :BelongsToPolymorphicAssociation, 'active_record/associations/belongs_to_polymorphic_association' + autoload :HasAndBelongsToManyAssociation, 'active_record/associations/has_and_belongs_to_many_association' + autoload :HasManyAssociation, 'active_record/associations/has_many_association' + autoload :HasManyThroughAssociation, 'active_record/associations/has_many_through_association' + autoload :HasOneAssociation, 'active_record/associations/has_one_association' + autoload :HasOneThroughAssociation, 'active_record/associations/has_one_through_association' + def self.included(base) base.extend(ClassMethods) end |