提交 32424b6b 编写于 作者: Z Zachary Scott

Merge pull request #21217 from myrridin/myrridin-documentation-updates

[ci skip] Documentation: Switch around a common phrase for readability
...@@ -172,7 +172,7 @@ def parameterize(sep = '-'.freeze) ...@@ -172,7 +172,7 @@ def parameterize(sep = '-'.freeze)
# uses the +pluralize+ method on the last word in the string. # uses the +pluralize+ method on the last word in the string.
# #
# 'RawScaledScorer'.tableize # => "raw_scaled_scorers" # 'RawScaledScorer'.tableize # => "raw_scaled_scorers"
# 'egg_and_ham'.tableize # => "egg_and_hams" # 'ham_and_egg'.tableize # => "ham_and_eggs"
# 'fancyCategory'.tableize # => "fancy_categories" # 'fancyCategory'.tableize # => "fancy_categories"
def tableize def tableize
ActiveSupport::Inflector.tableize(self) ActiveSupport::Inflector.tableize(self)
...@@ -182,7 +182,7 @@ def tableize ...@@ -182,7 +182,7 @@ def tableize
# Note that this returns a string and not a class. (To convert to an actual class # Note that this returns a string and not a class. (To convert to an actual class
# follow +classify+ with +constantize+.) # follow +classify+ with +constantize+.)
# #
# 'egg_and_hams'.classify # => "EggAndHam" # 'ham_and_eggs'.classify # => "HamAndEgg"
# 'posts'.classify # => "Post" # 'posts'.classify # => "Post"
def classify def classify
ActiveSupport::Inflector.classify(self) ActiveSupport::Inflector.classify(self)
......
...@@ -160,7 +160,7 @@ def titleize(word) ...@@ -160,7 +160,7 @@ def titleize(word)
# This method uses the #pluralize method on the last word in the string. # This method uses the #pluralize method on the last word in the string.
# #
# tableize('RawScaledScorer') # => "raw_scaled_scorers" # tableize('RawScaledScorer') # => "raw_scaled_scorers"
# tableize('egg_and_ham') # => "egg_and_hams" # tableize('ham_and_egg') # => "ham_and_eggs"
# tableize('fancyCategory') # => "fancy_categories" # tableize('fancyCategory') # => "fancy_categories"
def tableize(class_name) def tableize(class_name)
pluralize(underscore(class_name)) pluralize(underscore(class_name))
...@@ -170,7 +170,7 @@ def tableize(class_name) ...@@ -170,7 +170,7 @@ def tableize(class_name)
# names to models. Note that this returns a string and not a Class (To # names to models. Note that this returns a string and not a Class (To
# convert to an actual class follow +classify+ with #constantize). # convert to an actual class follow +classify+ with #constantize).
# #
# classify('egg_and_hams') # => "EggAndHam" # classify('ham_and_eggs') # => "HamAndEgg"
# classify('posts') # => "Post" # classify('posts') # => "Post"
# #
# Singular names are not handled correctly: # Singular names are not handled correctly:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册