diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-17 19:55:21 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-17 19:55:21 +0000 |
commit | 03e44cbcb2426a97dd35f76bc2ac6491c69821b1 (patch) | |
tree | 2ac9f210abdfaa14d16511d1528fc38f678c3eb3 | |
parent | 1b38c5523ecff17d4d78181db0fad1a74567c776 (diff) | |
download | rails-03e44cbcb2426a97dd35f76bc2ac6491c69821b1.tar.gz rails-03e44cbcb2426a97dd35f76bc2ac6491c69821b1.tar.bz2 rails-03e44cbcb2426a97dd35f76bc2ac6491c69821b1.zip |
Added Inflector.humanize to turn attribute names like employee_salary into "Employee salary". Used by automated error reporting in AR.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@450 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activesupport/lib/core_ext/string/inflections.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/core_ext/string/inflections.rb b/activesupport/lib/core_ext/string/inflections.rb index c63b0592b4..5d1070b00a 100644 --- a/activesupport/lib/core_ext/string/inflections.rb +++ b/activesupport/lib/core_ext/string/inflections.rb @@ -31,6 +31,10 @@ module ActiveSupport #:nodoc: def classify Inflector.classify(self) end + + def humanize + Inflector.humanize(self) + end def foreign_key(separate_class_name_and_id_with_underscore = true) Inflector.foreign_key(self, separate_class_name_and_id_with_underscore) |