diff options
Diffstat (limited to 'activerecord/lib/active_record.rb')
-rw-r--r-- | activerecord/lib/active_record.rb | 78 |
1 files changed, 44 insertions, 34 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index a894d83ea7..1675127ab0 100644 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -22,20 +22,54 @@ #++ require 'active_support' +require 'active_support/rails' require 'active_model' require 'arel' -require 'active_record_deprecated_finders' +require 'active_record/deprecated_finders' require 'active_record/version' module ActiveRecord extend ActiveSupport::Autoload + autoload :Base + autoload :Callbacks + autoload :Core + autoload :CounterCache + autoload :ConnectionHandling + autoload :DynamicMatchers + autoload :Explain + autoload :Inheritance + autoload :Integration + autoload :Migration + autoload :Migrator, 'active_record/migration' + autoload :Model + autoload :ModelSchema + autoload :NestedAttributes + autoload :Observer + autoload :Persistence + autoload :QueryCache + autoload :Querying + autoload :ReadonlyAttributes + autoload :Reflection + autoload :Sanitization + autoload :Schema + autoload :SchemaDumper + autoload :SchemaMigration + autoload :Scoping + autoload :Serialization + autoload :Store + autoload :Timestamp + autoload :Transactions + autoload :Translation + autoload :Validations + eager_autoload do autoload :ActiveRecordError, 'active_record/errors' autoload :ConnectionNotEstablished, 'active_record/errors' autoload :ConnectionAdapters, 'active_record/connection_adapters/abstract_adapter' + autoload :Aggregations autoload :Associations autoload :AttributeMethods autoload :AttributeAssignment @@ -51,43 +85,10 @@ module ActiveRecord autoload :PredicateBuilder autoload :SpawnMethods autoload :Batches - autoload :Explain autoload :Delegation end - autoload :Base - autoload :Callbacks - autoload :Core - autoload :CounterCache - autoload :ConnectionHandling - autoload :DynamicMatchers - autoload :Explain - autoload :Inheritance - autoload :Integration - autoload :Migration - autoload :Migrator, 'active_record/migration' - autoload :Model - autoload :ModelSchema - autoload :NestedAttributes - autoload :Observer - autoload :Persistence - autoload :QueryCache - autoload :Querying - autoload :ReadonlyAttributes - autoload :Reflection autoload :Result - autoload :Sanitization - autoload :Schema - autoload :SchemaDumper - autoload :SchemaMigration - autoload :Scoping - autoload :Serialization - autoload :SessionStore - autoload :Store - autoload :Timestamp - autoload :Transactions - autoload :Translation - autoload :Validations end module Coders @@ -148,6 +149,15 @@ module ActiveRecord autoload :TestCase autoload :TestFixtures, 'active_record/fixtures' + + def self.eager_load! + super + ActiveRecord::Locking.eager_load! + ActiveRecord::Scoping.eager_load! + ActiveRecord::Associations.eager_load! + ActiveRecord::AttributeMethods.eager_load! + ActiveRecord::ConnectionAdapters.eager_load! + end end ActiveSupport.on_load(:active_record) do |