From 9c65c539e2caa4590aded1975aead008f8135da4 Mon Sep 17 00:00:00 2001 From: claudiob Date: Wed, 24 Dec 2014 09:58:19 +0100 Subject: Add config to halt callback chain on return false This stems from [a comment](rails#17227 (comment)) by @dhh. In summary: * New Rails 5.0 apps will not accept `return false` as a way to halt callback chains, and will not display a deprecation warning. * Existing apps ported to Rails 5.0 will still accept `return false` as a way to halt callback chains, albeit with a deprecation warning. For this purpose, this commit introduces a Rails configuration option: ```ruby config.active_support.halt_callback_chains_on_return_false ``` For new Rails 5.0 apps, this option will be set to `false` by a new initializer `config/initializers/callback_terminator.rb`: ```ruby Rails.application.config.active_support.halt_callback_chains_on_return_false = false ``` For existing apps ported to Rails 5.0, the initializers above will not exist. Even running `rake rails:update` will not create this initializer. Since the default value of `halt_callback_chains_on_return_false` is set to `true`, these apps will still accept `return true` as a way to halt callback chains, displaying a deprecation warning. Developers will be able to switch to the new behavior (and stop the warning) by manually adding the line above to their `config/application.rb`. A gist with the suggested release notes to add to Rails 5.0 after this commit is available at https://gist.github.com/claudiob/614c59409fb7d11f2931 --- guides/source/configuring.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides/source/configuring.md') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 0a375d7cb8..5baab8a4b5 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -507,6 +507,8 @@ There are a few configuration options available in Active Support: * `config.active_support.time_precision` sets the precision of JSON encoded time values. Defaults to `3`. +* `config.active_support.halt_callback_chains_on_return_false` specifies whether ActiveRecord, ActiveModel and ActiveModel::Validations callback chains can be halted by returning `false` in a 'before' callback. Defaults to `true`. + * `ActiveSupport::Logger.silencer` is set to `false` to disable the ability to silence logging in a block. The default is `true`. * `ActiveSupport::Cache::Store.logger` specifies the logger to use within cache store operations. -- cgit v1.2.3 From f0466b619bf5f0d79f99962f9e0e242d2ffbd699 Mon Sep 17 00:00:00 2001 From: Sammy Larbi Date: Tue, 6 Jan 2015 08:52:00 -0600 Subject: Add log_level options to configuration guide --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/configuring.md') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 5baab8a4b5..622f79a50f 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -110,7 +110,7 @@ numbers. New applications filter out passwords by adding the following `config.f * `config.log_formatter` defines the formatter of the Rails logger. This option defaults to an instance of `ActiveSupport::Logger::SimpleFormatter` for all modes except production, where it defaults to `Logger::Formatter`. -* `config.log_level` defines the verbosity of the Rails logger. This option defaults to `:debug` for all environments. +* `config.log_level` defines the verbosity of the Rails logger. This option defaults to `:debug` for all environments. The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown. * `config.log_tags` accepts a list of methods that the `request` object responds to. This makes it easy to tag log lines with debug information like subdomain and request id - both very helpful in debugging multi-user production applications. -- cgit v1.2.3 From e56ab7769339aa57a29e9b60bdf8dfc65f26068e Mon Sep 17 00:00:00 2001 From: claudiob Date: Tue, 6 Jan 2015 14:04:47 -0800 Subject: Fix typo "you can be disable" Closes https://github.com/rails/rails/issues/18372 [ci skip] --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/configuring.md') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 0a375d7cb8..66f5fe100a 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -690,7 +690,7 @@ development: pool: 5 ``` -Prepared Statements are enabled by default on PostgreSQL. You can be disable prepared statements by setting `prepared_statements` to `false`: +Prepared Statements are enabled by default on PostgreSQL. You can disable prepared statements by setting `prepared_statements` to `false`: ```yaml production: -- cgit v1.2.3 From 5cfaf5a46eb154f98ba8963bdcfade0afdc618ad Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Wed, 14 Jan 2015 11:52:13 +0530 Subject: - Changed `IN` to `ON` in markdown renderer condition - Changed `IN` to `ON` in all note sentences in guides. --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/configuring.md') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 622f79a50f..cc3d840271 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -1,4 +1,4 @@ -**DO NOT READ THIS FILE IN GITHUB, GUIDES ARE PUBLISHED IN http://guides.rubyonrails.org.** +**DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON http://guides.rubyonrails.org.** Configuring Rails Applications ============================== -- cgit v1.2.3