From 76cd1ca08dc31babd7e9e527a8a9c86321ed905a Mon Sep 17 00:00:00 2001 From: Adam Hawkins Date: Sun, 15 Apr 2012 16:21:06 +0300 Subject: Add a "silence" behavior to completely turn off deprecation warnings. --- activesupport/lib/active_support/deprecation/behaviors.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb index 94f8d7133e..8d92c50679 100644 --- a/activesupport/lib/active_support/deprecation/behaviors.rb +++ b/activesupport/lib/active_support/deprecation/behaviors.rb @@ -41,8 +41,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 -- cgit v1.2.3 From 9608395923899e3f91e0d07ac2ed52efc17bcc40 Mon Sep 17 00:00:00 2001 From: twinturbo Date: Tue, 17 Apr 2012 22:01:06 +0200 Subject: Document #behavior= and update CHANGELOG --- activesupport/lib/active_support/deprecation/behaviors.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb index 8d92c50679..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 -- cgit v1.2.3