aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-19 19:41:15 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-19 19:41:15 -0300
commit43073b393d234acd094ac7c220163f4e419d11f5 (patch)
tree0d78982dfb1b93f929cc186c951f775a494af621 /guides
parent867631f9cfa6d639baacc09aac76e68819d5501f (diff)
downloadrails-43073b393d234acd094ac7c220163f4e419d11f5.tar.gz
rails-43073b393d234acd094ac7c220163f4e419d11f5.tar.bz2
rails-43073b393d234acd094ac7c220163f4e419d11f5.zip
Revert "Improve custom configuration"
This reverts commit de4891344ccc074f6d5693f4fac6ad610584e336. Conflicts: railties/lib/rails/railtie/configuration.rb It added regression. Will be back after the beta
Diffstat (limited to 'guides')
-rw-r--r--guides/source/4_2_release_notes.md18
-rw-r--r--guides/source/configuring.md16
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
```