I came across the following line in a Rails application I'm maintaining:
Rails.application.eager_load!
I googled it but didn't find anything that really spelled out what it does. What does it do?
I believe it requires all the files in the eager load paths. So all files from your controllers to your models will get ran which will load all your rails classes. Without doing this, I think you would have to explicitly require the file of the model or controller that you need before referencing it.
Someone wrote an article pertaining to it here which talks about config.eager_load
and what it does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With