diff options
author | Thomas Hart II <myrridin@gmail.com> | 2015-08-05 18:49:59 -0400 |
---|---|---|
committer | Thomas Hart II <myrridin@gmail.com> | 2015-08-05 18:49:59 -0400 |
commit | 6d077205b5269fc03c5318cecf378dd2592f2f4a (patch) | |
tree | 8160f2827a58e9e5298a9ba4d8b52ebf2ad3096f /activesupport/lib/active_support | |
parent | 90e893d447e2ae2f20a54a7b8aff4c46a7b108f6 (diff) | |
download | rails-6d077205b5269fc03c5318cecf378dd2592f2f4a.tar.gz rails-6d077205b5269fc03c5318cecf378dd2592f2f4a.tar.bz2 rails-6d077205b5269fc03c5318cecf378dd2592f2f4a.zip |
[ci skip] Switch around a common idiom for readability
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/inflections.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/inflector/methods.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/inflections.rb b/activesupport/lib/active_support/core_ext/string/inflections.rb index 97f9720b2b..689fc8427a 100644 --- a/activesupport/lib/active_support/core_ext/string/inflections.rb +++ b/activesupport/lib/active_support/core_ext/string/inflections.rb @@ -172,7 +172,7 @@ class String # uses the +pluralize+ method on the last word in the string. # # 'RawScaledScorer'.tableize # => "raw_scaled_scorers" - # 'egg_and_ham'.tableize # => "egg_and_hams" + # 'ham_and_egg'.tableize # => "ham_and_eggs" # 'fancyCategory'.tableize # => "fancy_categories" def tableize ActiveSupport::Inflector.tableize(self) @@ -182,7 +182,7 @@ class String # Note that this returns a string and not a class. (To convert to an actual class # follow +classify+ with +constantize+.) # - # 'egg_and_hams'.classify # => "EggAndHam" + # 'ham_and_eggs'.classify # => "HamAndEgg" # 'posts'.classify # => "Post" def classify ActiveSupport::Inflector.classify(self) diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index 60ef249e37..0a70d056ab 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -160,7 +160,7 @@ module ActiveSupport # This method uses the #pluralize method on the last word in the string. # # tableize('RawScaledScorer') # => "raw_scaled_scorers" - # tableize('egg_and_ham') # => "egg_and_hams" + # tableize('ham_and_egg') # => "ham_and_eggs" # tableize('fancyCategory') # => "fancy_categories" def tableize(class_name) pluralize(underscore(class_name)) @@ -170,7 +170,7 @@ module ActiveSupport # names to models. Note that this returns a string and not a Class (To # convert to an actual class follow +classify+ with #constantize). # - # classify('egg_and_hams') # => "EggAndHam" + # classify('ham_and_eggs') # => "HamAndEgg" # classify('posts') # => "Post" # # Singular names are not handled correctly: |