From 1f7e72ff519b7ff11986dbcd1ebe7a40f510ce90 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 17 Jan 2005 19:58:02 +0000 Subject: 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 --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ae743b086a..10a415899b 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -565,7 +565,7 @@ module ActiveRecord #:nodoc: # 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: -- cgit v1.2.3