Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7199 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Fix for pluralize (human => humen) and enhancements

Reported by: jeremymcanally Assigned to: core
Priority: normal Milestone: 1.2
Component: ActiveSupport Version: edge
Severity: minor Keywords:
Cc:

Description

Some of the inflections in inflections.rb were missing (e.g., the -um to -a inflection, like medium to media), incomplete (e.g., octopus and virus aren't the only ones to match their pattern), or poorly constructed (e.g., try to pluralize "human"; you get "humen").

This patch fills those out, makes a few corrections (i.e., there was no singularize pattern for matrices, indices, or vertices, but there was a pluralize pattern), and adds a few new ones.

Attachments

more_inflector_inflections.diff (3.0 kB) - added by jeremymcanally on 01/19/07 13:49:34.
more_inflector_inflections.2.diff (3.7 kB) - added by jeremymcanally on 01/19/07 14:08:51.
Svn diff - fixed and streamlined, also with more tests

Change History

01/19/07 13:49:34 changed by jeremymcanally

  • attachment more_inflector_inflections.diff added.

01/19/07 13:52:15 changed by jeremymcanally

Eek. Some of the tests fail with a last second adjustmen I made; reverting it really quick...new patch in a minute.

01/19/07 14:08:51 changed by jeremymcanally

  • attachment more_inflector_inflections.2.diff added.

Svn diff - fixed and streamlined, also with more tests

(follow-up: ↓ 3 ) 01/19/07 22:19:24 changed by ben

  • status changed from new to closed.
  • resolution set to wontfix.

Inflections have been closed for some time.

(in reply to: ↑ 2 ) 01/20/07 00:29:20 changed by jeremymcanally

  • status changed from closed to reopened.
  • type changed from enhancement to defect.
  • resolution deleted.
  • summary changed from [PATCH] Better and more inflections to [PATCH] Fix for pluralize (human => humen) and enhancements.

Replying to ben:

Inflections have been closed for some time.

Oh, thanks for pointing that out! I was unaware of this, but I thnk this should be reopened since it fixes a defect.

mystring = "human"
Inflect.pluralize(mystring)
=> "humen"

If they dont' want to add the enhancements, fine, but that bit me when I was showing Rails to a friend. People goes to people, but human goes to humen? Not good... ;)

01/20/07 00:49:43 changed by manfred

No, but this is where the inflection part in config/environment.rb is for.

01/20/07 07:17:59 changed by hasmanyjosh

  • status changed from reopened to closed.
  • resolution set to wontfix.

There are many words that get pluralized incorrectly with only the stock inflections, and this example is no more a bug than they are. Inflections really are closed, until such a time as there is an overhaul of the stock inflection set, if ever.