diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-07-27 16:13:22 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-07-27 16:15:19 -0400 |
commit | 17169cfb7167e357d50290eace083ce3b38bfb7f (patch) | |
tree | 5fb8e509b2c6673d0d9cde8bdb2fc28358817e96 /activerecord/lib/active_record | |
parent | 566c2c4498cc88cae3f1a999e4cb49f836e89efb (diff) | |
download | rails-17169cfb7167e357d50290eace083ce3b38bfb7f.tar.gz rails-17169cfb7167e357d50290eace083ce3b38bfb7f.tar.bz2 rails-17169cfb7167e357d50290eace083ce3b38bfb7f.zip |
Eager load the association classes on boot
We were expecting those classes to be loaded when an association is
defined but they are not.
If you add a debugger on the first line of any of those classes and try
to define the corresponding association you will see that the classes
are not loaded.
Fixes #26273
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index e86e02c53a..840f71bef2 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -224,13 +224,6 @@ module ActiveRecord autoload :CollectionAssociation autoload :ForeignAssociation autoload :CollectionProxy - - autoload :BelongsToAssociation - autoload :BelongsToPolymorphicAssociation - autoload :HasManyAssociation - autoload :HasManyThroughAssociation - autoload :HasOneAssociation - autoload :HasOneThroughAssociation autoload :ThroughAssociation module Builder #:nodoc: @@ -245,6 +238,13 @@ module ActiveRecord end eager_autoload do + autoload :BelongsToAssociation + autoload :BelongsToPolymorphicAssociation + autoload :HasManyAssociation + autoload :HasManyThroughAssociation + autoload :HasOneAssociation + autoload :HasOneThroughAssociation + autoload :Preloader autoload :JoinDependency autoload :AssociationScope |