Method: Rails::Mongoid#load_models

Defined in:
lib/rails/mongoid.rb

#load_models(app) ⇒ Object

Use the application configuration to get every model and require it, so that indexing and inheritance work in both development and production with the same results.

Examples:

Load all the application models.

Rails::Mongoid.load_models(app)

Parameters:

  • app (Application)

    The rails application.



18
19
20
# File 'lib/rails/mongoid.rb', line 18

def load_models(app)
  ::Mongoid.load_models(app.config.paths["app/models"].expanded)
end