-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add mongoid.rb rails initializer * write all available config options to the mongoid.rb initializer * let's try loading mongoid.yml after all other config has loaded this is so that the YAML options can override any options set in the the config/initializers. * remove Mongoid options from the mongoid.yml template Preference is now for these to be specified in the config/initializers/mongoid.rb initializer, though if present in the mongoid.yml file, they'll still be processed. * update docs to reference the mongoid.rb initializers * Revert "update docs to reference the mongoid.rb initializers" This reverts commit 05e2be9. * prefer the YAML file for Mongoid configuration but let's still auto-generate the default config by parsing the Mongoid::Config file... * fix tests * update docs * revert changes to mongoid.yml (in favor of #5539)
- Loading branch information
Showing
8 changed files
with
108 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Mongoid.configure do | ||
target_version = "<%= Mongoid::VERSION[/^\d+\.\d+/] %>" | ||
|
||
# Load Mongoid behavior defaults. This automatically sets | ||
# features flags (refer to documentation) | ||
config.load_defaults target_version | ||
|
||
# It is recommended to use config/mongoid.yml for most Mongoid-related | ||
# configuration, whenever possible, but if you prefer, you can set | ||
# configuration values here, instead: | ||
# | ||
# config.log_level = :debug | ||
# | ||
# Note that the settings in config/mongoid.yml always take precedence, | ||
# whatever else is set here. | ||
end | ||
|
||
# Enable Mongo driver query cache for Rack | ||
# Rails.application.config.middleware.use(Mongo::QueryCache::Middleware) | ||
|
||
# Enable Mongo driver query cache for ActiveJob | ||
# ActiveSupport.on_load(:active_job) do | ||
# include Mongo::QueryCache::Middleware::ActiveJob | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters