aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2014-05-06 21:25:52 +0200
committerXavier Noria <fxn@hashref.com>2014-05-06 21:35:40 +0200
commitdaaa21bc7d20f2e4ff451637423a25ff2d5e75c7 (patch)
tree10bbaa94ccaad20e1507dc29ed0c9153e18c18a9 /activesupport/test
parentd97581921b0ff7a31ce63fef4687437594f38447 (diff)
downloadrails-daaa21bc7d20f2e4ff451637423a25ff2d5e75c7.tar.gz
rails-daaa21bc7d20f2e4ff451637423a25ff2d5e75c7.tar.bz2
rails-daaa21bc7d20f2e4ff451637423a25ff2d5e75c7.zip
several enhancements to humanize [closes #12288]
* Strips leading underscores. * Changes some unnecessary gsub!s to sub!s. * Replaces some anchors ^, $ with \A, \z. * Documents that human inflection rules are applied. * Documents that words are downcased except acronyms. * Adds an example with an acronym. * Rewords docs.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/inflector_test_cases.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb
index dd03a61176..b556da0046 100644
--- a/activesupport/test/inflector_test_cases.rb
+++ b/activesupport/test/inflector_test_cases.rb
@@ -208,9 +208,11 @@ module InflectorTestCases
}
UnderscoreToHuman = {
- "employee_salary" => "Employee salary",
- "employee_id" => "Employee",
- "underground" => "Underground"
+ 'employee_salary' => 'Employee salary',
+ 'employee_id' => 'Employee',
+ 'underground' => 'Underground',
+ '_id' => 'Id',
+ '_external_id' => 'External'
}
UnderscoreToHumanWithoutCapitalize = {