Module: Rails::Mongoid
Overview
Mongoid utilities for Rails
Defined Under Namespace
Classes: Railtie
Instance Method Summary collapse
-
#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.
-
#preload_models(app) ⇒ Object
Conditionally calls
Rails::Mongoid.load_models(app)if the::Mongoid.preload_modelsistrue.
Instance Method Details
#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.
16 17 18 |
# File 'lib/rails/mongoid.rb', line 16 def load_models(app) ::Mongoid.load_models(app.config.paths['app/models'].) end |
#preload_models(app) ⇒ Object
Conditionally calls Rails::Mongoid.load_models(app) if the
::Mongoid.preload_models is true.
24 25 26 |
# File 'lib/rails/mongoid.rb', line 24 def preload_models(app) load_models(app) if ::Mongoid.preload_models end |