aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-07-27 16:13:22 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-07-27 16:15:19 -0400
commit17169cfb7167e357d50290eace083ce3b38bfb7f (patch)
tree5fb8e509b2c6673d0d9cde8bdb2fc28358817e96 /activerecord
parent566c2c4498cc88cae3f1a999e4cb49f836e89efb (diff)
downloadrails-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')
-rw-r--r--activerecord/lib/active_record/associations.rb14
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