This project is archived and is in readonly mode.
Inflections for uncountables works badly for "funky jeans"
Reported by Rolf Bjaanes | December 15th, 2009 @ 06:07 PM | in 2.x
My "funky jeans" turned into "funky jean" when I tried to call
singularize on it with
"jeans" added as an uncountable inflector.
– I went ahead and made a fix and added tests.
It should be patched onto both 2-3-stable and master as the problem exists in both places.
Comments and changes to this ticket
-
Rolf Bjaanes December 15th, 2009 @ 06:46 PM
- Tag changed from inflection, inflections, uncountable to 2-3-stable, 3-0, inflection, inflections, uncountable
-
Rolf Bjaanes December 16th, 2009 @ 01:17 PM
The patch done to /activesupport/lib/active_support/inflections.rb may be disregarded.
And the patch fixes some issues with nested urls which could turn into "admin_jean".This is especially true for 2-3-stable which does a underscore on routes before doing singularize.
-
Rizwan Reza January 17th, 2010 @ 02:16 AM
- Tag changed from 2-3-stable, 3-0, inflection, inflections, uncountable to 2-3-stable, inflection, inflections, uncountable
-
José Valim April 3rd, 2010 @ 06:33 PM
- State changed from new to wontfix
It has been a long time since Rails does not add any extra inflection (you can see other tickets in LH were already rejected). You should define this one in your application.
-
Rolf Bjaanes April 3rd, 2010 @ 06:44 PM
Point wasn't adding the extra inflection itself, but that funky jeans was singularized to funky jean – which at the moment held true for any uncountable with based on two or more words :)
-
José Valim April 3rd, 2010 @ 06:50 PM
- Milestone set to 2.x
- State changed from wontfix to open
- Assigned user set to José Valim
Oh, my bad. I'm assigning it to me and I will apply it later!
-
Rolf Bjaanes April 3rd, 2010 @ 07:13 PM
- Assigned user cleared.
No problems :)
I see the same code is used / unpatched in master, so you might want to see if it should go there too?
-
José Valim April 3rd, 2010 @ 07:14 PM
- Assigned user set to José Valim
Don't worry, I will apply the patch in both branches. :)
-
Rolf Bjaanes April 3rd, 2010 @ 07:29 PM
Oh, it said milestone 2.x
Btw, I can't think of many cases other than "jeans" and "[put word here] jeans" it'll be applicable, but
atleast it won't try to singularize if people supply "a pair of scissors" and scissors is in the uncountables :)Besides, look! There are tests! :)
-
Repository April 5th, 2010 @ 11:23 PM
- State changed from open to resolved
(from [4eab983b955fe17cf02c6fe96cab1c8a309cd606]) Changed the way inflections for uncountables work for 'funky jeans' [#3576 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/4eab983b955fe17cf02c6fe96cab1c... -
José Valim April 5th, 2010 @ 11:26 PM
- State changed from resolved to open
Hey mate, I could not apply the patch in 2-3-stable branch. Can you please rebase it? Thanks!
-
Rolf Bjaanes April 5th, 2010 @ 11:44 PM
I'll find time for it tomorrow or the day after.
Crazy busy changing apartments :)Thanks btw :)
This feel good. -
Rolf Bjaanes April 8th, 2010 @ 09:07 PM
A bit later than expected, but here it is.
Patch with tests attached. -
José Valim April 10th, 2010 @ 12:32 PM
- State changed from open to committed
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4226 Possible bug with uncountable inflections and namedspace routes? Could this be related to https://rails.lighthouseapp.com...
- 3576 Inflections for uncountables works badly for "funky jeans" (from [4eab983b955fe17cf02c6fe96cab1c8a309cd606]) Changed...