diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-18 10:07:56 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-18 10:08:19 -0700 |
commit | d424df0a90a91618965c62ea213781f35bf64eec (patch) | |
tree | 2296b47dd0860820f20ef30df0213e47f61bdd3e /guides | |
parent | be69024db9a73488aaf1c1d3334e0dfcde2339d7 (diff) | |
download | rails-d424df0a90a91618965c62ea213781f35bf64eec.tar.gz rails-d424df0a90a91618965c62ea213781f35bf64eec.tar.bz2 rails-d424df0a90a91618965c62ea213781f35bf64eec.zip |
:nail_care: [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/4_2_release_notes.md | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/guides/source/4_2_release_notes.md b/guides/source/4_2_release_notes.md index dbfda9c03e..38e7d9d7fd 100644 --- a/guides/source/4_2_release_notes.md +++ b/guides/source/4_2_release_notes.md @@ -77,35 +77,41 @@ Please refer to the [Changelog][railties] for detailed changes. * Introduced the `x` namespace for defining custom configuration options: - # config/environments/production.rb - config.x.payment_processing.schedule = :daily - config.x.payment_processing.retries = 3 - config.x.super_debugger = true + ```ruby + # config/environments/production.rb + 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: - 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 + ```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 + ``` ([Commit](https://github.com/rails/rails/commit/611849772dd66c2e4d005dcfe153f7ce79a8a7db)) * Introduced `Rails::Application.config_for` to load a configuration for the current environment. - # config/exception_notification.yml: - production: - url: http://127.0.0.1:8080 - namespace: my_app_production - development: - url: http://localhost:3001 - namespace: my_app_development - - # config/production.rb - MyApp::Application.configure do - config.middleware.use ExceptionNotifier, config_for(:exception_notification) - end + ```ruby + # config/exception_notification.yml: + production: + url: http://127.0.0.1:8080 + namespace: my_app_production + development: + url: http://localhost:3001 + namespace: my_app_development + + # config/production.rb + MyApp::Application.configure do + config.middleware.use ExceptionNotifier, config_for(:exception_notification) + end + ``` ([Pull Request](https://github.com/rails/rails/pull/16129)) |