diff options
author | José Valim <jose.valim@gmail.com> | 2012-04-29 01:24:27 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-04-29 01:24:27 -0700 |
commit | ffc861c101c3d7284a512c1ac407a4027a0f175e (patch) | |
tree | 4fd0534663b94cb8d5e7752212fbe98f97cce2bf /activesupport/lib | |
parent | e73f54763568f06588c227c7ca759178102b914d (diff) | |
parent | 34599c4f57121bf693886b39f9a9724d41998514 (diff) | |
download | rails-ffc861c101c3d7284a512c1ac407a4027a0f175e.tar.gz rails-ffc861c101c3d7284a512c1ac407a4027a0f175e.tar.bz2 rails-ffc861c101c3d7284a512c1ac407a4027a0f175e.zip |
Merge pull request #5986 from carlosantoniodasilva/deprecation-behavior-silence
Add a "silence" behavior to completely turn off deprecation warnings.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/deprecation/behaviors.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb index 94f8d7133e..73b6a42505 100644 --- a/activesupport/lib/active_support/deprecation/behaviors.rb +++ b/activesupport/lib/active_support/deprecation/behaviors.rb @@ -13,6 +13,13 @@ module ActiveSupport # Sets the behavior to the specified value. Can be a single value or an array. # + # Available behaviors: + # + # [+:stderr+] Print deprecations to +$stderror+ + # [+:log+] Send to +Rails.logger+ + # [+:notify+] Instrument using +ActiveSupport::Notifications+ + # [+:silence+] Do nothing + # # Examples # # ActiveSupport::Deprecation.behavior = :stderr @@ -41,8 +48,9 @@ module ActiveSupport }, :notify => Proc.new { |message, callstack| ActiveSupport::Notifications.instrument("deprecation.rails", - :message => message, :callstack => callstack) - } + :message => message, :callstack => callstack) + }, + :silence => Proc.new { |message, callstack| } } end end |