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

Ticket #9127 (new defect)

Opened 1 year ago

Last modified 11 months ago

[PATCH] Deprecation warnings for association options print a duplicate rubyonrails.org URL

Reported by: kampers Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: tiny deprecation
Cc:

Description

When you use :dependent => true or :exclusively_dependent => true, the deprecation message printed to the console contains the deprecation reference URL twice:

DEPRECATION WARNING: The :dependent => true option is deprecated and will
be removed from Rails 2.0.  Please use :dependent => :destroy instead. See
http://www.rubyonrails.org/deprecation for details.  See
http://www.rubyonrails.org/deprecation for details. (called from has_many at
/Users/chrisk/railstest/vendor/rails/activerecord/lib/active_record/associations.rb:673)

It's because ActiveSupport::Deprecation.warn prints the URL message for every deprecation, but the URL is specified in the deprecation messages for these two methods as well.

Attached patch generated against trunk as of [7247].

Attachments

remove_duplicate_deprecation_message_url.diff (1.5 kB) - added by kampers on 07/28/07 16:51:17.
remove_duplicate_deprecation_message_url.1-2-stable.diff (1.5 kB) - added by kampers on 02/09/08 19:24:42.
Updated for current 1-2-stable branch

Change History

07/28/07 16:51:17 changed by kampers

  • attachment remove_duplicate_deprecation_message_url.diff added.

07/28/07 17:46:51 changed by lifofifo

I think this should be be against 1-2-stable branch.

07/28/07 18:10:02 changed by kampers

Yeah--maybe we should apply this to 1-2-stable and remove those deprecated options from the trunk entirely. Thoughts?

07/28/07 18:15:08 changed by lifofifo

Yeah. All the deprecated stuff is gonna go from edge. I had once started to write a patch to remove all deprecated methods for AR, but it was getting way too big. I think it might be a good idea to remove deprecated methods from edge in 3-4 iterations for each component.

08/30/07 18:34:17 changed by kampers

OK, here's a patch for 1-2-stable.

A new ticket for removing the options entirely from trunk is at #9447.

02/09/08 19:24:42 changed by kampers

  • attachment remove_duplicate_deprecation_message_url.1-2-stable.diff added.

Updated for current 1-2-stable branch