-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Added Rails::Mongoid.preload_models to handle conditional loading of models
This moves the the conditional check for the preload_models config away from
load_models. Let Rails::Mongoid.load_models load the models as the name implies
regardless of the config option.
I ran into a scenario where I needed to load all the models before running a thor task, but there was no easy way to do so, because load_models(app) checked to see if the preload_models config was set or not, and preload_models defaults to false now. This new method handles the conditional check of whether or not to preload models, but the load_models method now loads all models regardless of the config.