diff options
author | Yves Senn <yves.senn@gmail.com> | 2016-11-21 12:41:35 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2016-11-21 12:41:35 +0100 |
commit | fc4c15d823b112cc440cbd9a4288e1a389c138da (patch) | |
tree | 3c8a0a2ca024d959b132914e4e6871d27deb658a /activerecord/test/cases/view_test.rb | |
parent | 6d6249b1c1abda4f62fafcc42a7ece570c8da7e9 (diff) | |
download | rails-fc4c15d823b112cc440cbd9a4288e1a389c138da.tar.gz rails-fc4c15d823b112cc440cbd9a4288e1a389c138da.tar.bz2 rails-fc4c15d823b112cc440cbd9a4288e1a389c138da.zip |
`eager_autoload` needs to be triggered for nested constants.
When `ActiveRecord::Associations.eager_load!` is called, it eager loads
the `Preloader` but does not trigger a `eager_load!` on the `Preloader`
itself. A eager loaded component is responsible to forward the
`eager_load!` call to nested constants that make use of `eager_autoload`
as well.
This will also resolve the occasional `NameError` that we've observed in
production:
```
NameError: uninitialized constant ActiveRecord::Associations::Preloader::BelongsTo
```
Diffstat (limited to 'activerecord/test/cases/view_test.rb')
0 files changed, 0 insertions, 0 deletions