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

Ticket #8760 (new defect)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Formally deprecate and remove uses of AR::Base::human_attribute_name

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

Description

ActiveRecord::Base::human_attribute_name was deprecated by DHH over two years ago in [773], but we didn't have a formal deprecation mechanism back then, and it's remained in use here and there across the AR codebase.

The method was deprecated in favor of just using the humanize inflector directly. I made this change in two places, and I put in a formal deprecation warning to go with DHH's original comment.

Note that without this method, we're left without a handy hook to change the way the attribute names get humanized. The cleanest way to solve this, I think, is to let us add custom inflections for humanize the same way we do for pluralize. There's a lovely, verified patch for this over in this neck of the woods: #6989.

Attachments

deprecate_arb_human_attribute_name.diff (2.0 kB) - added by kampers on 06/26/07 11:42:57.
deprecate_arb_human_attribute_name.2.diff (2.0 kB) - added by kampers on 02/03/08 08:01:39.
updated for trunk

Change History

06/26/07 11:42:57 changed by kampers

  • attachment deprecate_arb_human_attribute_name.diff added.

07/25/07 03:28:32 changed by kampers

I haven't tried this (yet), but there's a plugin out there to restore this if we completely remove the method for Rails 2.0. See the Human Attribute Override plugin.

02/03/08 08:01:39 changed by kampers

  • attachment deprecate_arb_human_attribute_name.2.diff added.

updated for trunk