Method: Mongoid::Loadable#load_models
- Defined in:
- lib/mongoid/loadable.rb
#load_models(paths = model_paths) ⇒ Object
Search a list of model paths to get every model and require it, so that indexing and inheritance work in both development and production with the same results.
33 34 35 36 37 38 39 40 41 |
# File 'lib/mongoid/loadable.rb', line 33 def load_models(paths = model_paths) files = files_under_paths(paths) files.sort.each do |file| load_model(file) end nil end |