From 611849772dd66c2e4d005dcfe153f7ce79a8a7db Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Aug 2014 15:48:14 -0700 Subject: Pull in the custom configuration concept from dhh/custom_configuration --- guides/source/configuring.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 6e897d1714..305adb0608 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -996,3 +996,24 @@ If you get the above error, you might want to increase the size of connection pool by incrementing the `pool` option in `database.yml` NOTE. If you are running in a multi-threaded environment, there could be a chance that several threads may be accessing multiple connections simultaneously. So depending on your current request load, you could very well have multiple threads contending for a limited amount of connections. + + +Custom configuration +-------------------- + +You can configure your own code through the Rails configuration object with custom configuration. It works like this: + + ```ruby + config.x.payment_processing.schedule = :daily + config.x.payment_processing.retries = 3 + config.x.super_debugger = true + ``` + +These configuration points are then available through the configuration object: + + ```ruby + Rails.configuration.x.payment_processing.schedule # => :daily + Rails.configuration.x.payment_processing.retries # => 3 + Rails.configuration.x.super_debugger # => true + Rails.configuration.x.super_debugger.not_set # => nil + ``` -- cgit v1.2.3