new

new(object, message, deprecator = ActiveSupport::Deprecation.instance) Class Public methods

deprecate_methods

deprecate_methods(target_module, *method_names) Instance Public methods Declare that a method has been deprecated. module Fred extend self def foo; end def bar; end def baz; end end ActiveSupport::Deprecation.deprecate_methods(Fred, :foo, bar: :qux, baz: 'use Bar#baz instead') # => [:foo, :bar, :baz] Fred.foo # => "DEPRECATION WARNING: foo is deprecated and will be removed from Rails 4.1." Fred.bar # => "DEPRECATION WARNING: bar is deprecated and will be remove

deprecation_warning

deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil) Instance Public methods

silence

silence() Instance Public methods Silence deprecation warnings within the block. ActiveSupport::Deprecation.warn('something broke!') # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" ActiveSupport::Deprecation.silence do ActiveSupport::Deprecation.warn('something broke!') end # => nil

warn

warn(message = nil, callstack = nil) Instance Public methods Outputs a deprecation warning to the output configured by ActiveSupport::Deprecation.behavior. ActiveSupport::Deprecation.warn('something broke!') # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)"

new

new(deprecation_horizon = '4.2', gem_name = 'Rails') Class Public methods It accepts two parameters on initialization. The first is a version of library and the second is a library name ActiveSupport::Deprecation.new('2.0', 'MyLibrary')

clear

clear() Class Public methods

descendants

descendants(klass) Class Public methods

direct_descendants

direct_descendants(klass) Class Public methods

store_inherited

store_inherited(klass, descendant) Class Public methods This is the only method that is not thread safe, but is only ever called during the eager loading phase.