aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-17 19:58:02 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-17 19:58:02 +0000
commit1f7e72ff519b7ff11986dbcd1ebe7a40f510ce90 (patch)
tree558b3948deef201e8fd5fa13a45cfa803f3638f5 /activerecord
parent03e44cbcb2426a97dd35f76bc2ac6491c69821b1 (diff)
downloadrails-1f7e72ff519b7ff11986dbcd1ebe7a40f510ce90.tar.gz
rails-1f7e72ff519b7ff11986dbcd1ebe7a40f510ce90.tar.bz2
rails-1f7e72ff519b7ff11986dbcd1ebe7a40f510ce90.zip
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
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
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: