aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2015-05-25 00:03:58 +0100
committerAbdelkader Boudih <terminale@gmail.com>2015-05-25 00:03:58 +0100
commitac1368a36768b547c72024031009c8de2f525d32 (patch)
treeb87021bd7db1ad18582b87532724423d0e7075ad /activesupport
parentc0c90af41a83bcd97eb6dc57933b94996f6c5a47 (diff)
parent0f53b010f963e625a5c02edbb7500b52630ec34c (diff)
downloadrails-ac1368a36768b547c72024031009c8de2f525d32.tar.gz
rails-ac1368a36768b547c72024031009c8de2f525d32.tar.bz2
rails-ac1368a36768b547c72024031009c8de2f525d32.zip
Merge pull request #20286 from davydovanton/doc-deprecation-behavior
Add documentation for Deprecation::Behavior module
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/deprecation/behaviors.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb
index 9f9dca8453..0cdc7e96f7 100644
--- a/activesupport/lib/active_support/deprecation/behaviors.rb
+++ b/activesupport/lib/active_support/deprecation/behaviors.rb
@@ -38,6 +38,18 @@ module ActiveSupport
silence: ->(message, callstack) {},
}
+ # Behavior module allows to determine how to display deprecation messages.
+ # You can set any behaviors from +DEFAULT_BEHAVIORS+ constant or create
+ # custom behavior. Available behaviors:
+ #
+ # [+raise+] Raise <tt>ActiveSupport::DeprecationException</tt>.
+ # [+stderr+] Log all deprecation warnings to +$stderr+.
+ # [+log+] Log all deprecation warnings to +Rails.logger+.
+ # [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+.
+ # [+silence+] Do nothing.
+ #
+ # Setting behaviors only affects deprecations that happen after boot time.
+ # For more information you can read documentation for +behavior=+ method.
module Behavior
# Whether to print a backtrace along with the warning.
attr_accessor :debug