Permalink
Browse files

Made human_attribute_name(attribute_key_name) use Inflector.humanize

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@451 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 03e44cb commit 1f7e72ff519b7ff11986dbcd1ebe7a40f510ce90 @dhh dhh committed Jan 17, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/base.rb
@@ -565,7 +565,7 @@ def reset_column_information_and_inheritable_attributes_for_all_subclasses
# Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
# Person.human_attribute_name("first_name") # => "First name"
def human_attribute_name(attribute_key_name)
- attribute_key_name.gsub(/_/, " ").capitalize unless attribute_key_name.nil?
+ attribute_key_name.humanize
end
def descends_from_active_record? # :nodoc:

0 comments on commit 1f7e72f

Please sign in to comment.