diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/4_2_release_notes.md | 18 | ||||
-rw-r--r-- | guides/source/configuring.md | 16 |
2 files changed, 15 insertions, 19 deletions
diff --git a/guides/source/4_2_release_notes.md b/guides/source/4_2_release_notes.md index b90e5025e2..f710b8bac9 100644 --- a/guides/source/4_2_release_notes.md +++ b/guides/source/4_2_release_notes.md @@ -78,24 +78,22 @@ Please refer to the [Changelog][railties] for detailed changes. * Introduced an `after_bundle` callback for use in Rails templates. ([Pull Request](https://github.com/rails/rails/pull/16359)) -* Custom configuration options can be chained: +* Introduced the `x` namespace for defining custom configuration options: ```ruby # config/environments/production.rb - config.payment_processing.schedule = :daily - config.payment_processing.retries = 3 - config.resque = { timeout: 60, inline_jobs: :always } - config.super_debugger = true + config.x.payment_processing.schedule = :daily + config.x.payment_processing.retries = 3 + config.x.super_debugger = true ``` These options are then available through the configuration object: ```ruby - Rails.configuration.payment_processing.schedule # => :daily - Rails.configuration.payment_processing.retries # => 3 - Rails.configuration.resque.timeout # => 60 - Rails.configuration.resque.inline_jobs # => :always - Rails.configuration.super_debugger # => true + 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 ``` ([Commit](https://github.com/rails/rails/commit/611849772dd66c2e4d005dcfe153f7ce79a8a7db)) diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 6922dd681a..801cef5ca6 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -1006,18 +1006,16 @@ Custom configuration You can configure your own code through the Rails configuration object with custom configuration. It works like this: ```ruby - config.payment_processing.schedule = :daily - config.payment_processing.retries = 3 - config.resque = { timeout: 60, inline_jobs: :always } - config.super_debugger = true + 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.payment_processing.schedule # => :daily - Rails.configuration.payment_processing.retries # => 3 - Rails.configuration.resque.timeout # => 60 - Rails.configuration.resque.inline_jobs # => :always - Rails.configuration.super_debugger # => true + 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 ``` |