lib/active_support/inflector/methods.rb in activesupport-7.0.4.3 vs lib/active_support/inflector/methods.rb in activesupport-7.0.5

- old
+ new

@@ -194,12 +194,12 @@ def tableize(class_name) pluralize(underscore(class_name)) end # Creates a class name from a plural table name like Rails does for table - # names to models. Note that this returns a string and not a Class (To - # convert to an actual class follow +classify+ with #constantize). + # names to models. Note that this returns a string and not a Class. (To + # convert to an actual class follow +classify+ with #constantize.) # # classify('ham_and_eggs') # => "HamAndEgg" # classify('posts') # => "Post" # # Singular names are not handled correctly: @@ -359,11 +359,11 @@ # Applies inflection rules for +singularize+ and +pluralize+. # # If passed an optional +locale+ parameter, the uncountables will be # found for that locale. # - # apply_inflections('post', inflections.plurals, :en) # => "posts" - # apply_inflections('posts', inflections.singulars, :en) # => "post" + # apply_inflections('post', inflections.plurals, :en) # => "posts" + # apply_inflections('posts', inflections.singulars, :en) # => "post" def apply_inflections(word, rules, locale = :en) result = word.to_s.dup if word.empty? || inflections(locale).uncountables.uncountable?(result) result