-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Of course you also have a gem for string inflection...
You are my one stop shop for "gem supplies" 🛒
Problem
Strings::Inflection.plural? on irregular plurals fails.
Reproduction
require 'strings-inflection'
require 'strings/inflection/extensions'
using Strings::Inflection::Extensions
# These fail
p 'people'.pluralize == 'people' # => false
p 'people'.plural? == true # => false
p 'children'.plural? == true # => false
# These are all ok, just here as a "full test suite"
p 'person'.singular? == true
p 'child'.singular? == true
p 'people'.singular? == false
p 'children'.singular? == false
p 'person'.plural? == false
p 'child'.plural? == falseAdditional information
The underlying root cause of this problem, is that the gem returns "peoples" as the plural form of people, which is wrong. In ActiveSupport Inflector, it is returned properly:
>> require 'active_support/inflector'
=> true
>> "people".singularize
=> "person"
>> "people".pluralize
=> "people"Metadata
Metadata
Assignees
Labels
No labels