Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11450 (new enhancement)

Opened 4 months ago

[PATCH] Allow users to use Deprecation.warn in their own applications

Reported by: thechrisoshow Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords:
Cc:

Description

Deprecation.warn is a really nice little method used in Rails to signify when a method has been deprecated.

I've been using this method in my own rails plugins, but I've noticed that the default warning:

Default.warn "This method is deprecated" 

procuces this:

DEPRECATION WARNING: This method is deprecated  See http://www.rubyonrails.org/deprecation for details.

The http://www.rubyonrails.org/deprecation for details bit is irrelevant for my own deprecated methods.

Now instead you set the detail message using this in your environment.rb or init.rb:

ActiveSupport::Deprecation.detail_message = "Custom message for each deprecation"

Thus allowing common folk to use this handy little method in their own applications/plugins.

This patch includes tests and improved deprecation docs

Attachments

deprecation_warnings_for_the_masses.diff (3.8 kB) - added by thechrisoshow on 03/27/08 22:29:20.
includes docs and tests

Change History

03/27/08 22:29:20 changed by thechrisoshow

  • attachment deprecation_warnings_for_the_masses.diff added.

includes docs and tests