From 43073b393d234acd094ac7c220163f4e419d11f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 19 Aug 2014 19:41:15 -0300 Subject: Revert "Improve custom configuration" This reverts commit de4891344ccc074f6d5693f4fac6ad610584e336. Conflicts: railties/lib/rails/railtie/configuration.rb It added regression. Will be back after the beta --- guides/source/4_2_release_notes.md | 18 ++++++++---------- guides/source/configuring.md | 16 +++++++--------- 2 files changed, 15 insertions(+), 19 deletions(-) (limited to 'guides') 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 ``` -- cgit v1.2.3