Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Inflections for uncountables works badly for "funky jeans"

#3576

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.

Reported by Rolf Bjaanes · December 15th, 2009 @ 06:07 PM

State: committed
Milestone: 2.x
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Rolf Bjaanes
    Rolf Bjaanes
    • Tag changed from inflection, inflections, uncountable to 2-3-stable, 3-0, inflection, inflections, uncountable

    December 15th, 2009 @ 06:46 PM

  2. Rolf Bjaanes
    Rolf Bjaanes

    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.

    December 16th, 2009 @ 01:17 PM

  3. Rizwan Reza
    Rizwan Reza
    • Tag changed from 2-3-stable, 3-0, inflection, inflections, uncountable to 2-3-stable, inflection, inflections, uncountable

    January 17th, 2010 @ 02:16 AM

  4. José Valim
    José Valim
    • 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.

    April 3rd, 2010 @ 06:33 PM

  5. Rolf Bjaanes
    Rolf Bjaanes

    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 :)

    April 3rd, 2010 @ 06:44 PM

  6. José Valim
    José Valim
    • 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!

    April 3rd, 2010 @ 06:50 PM

  7. Rolf Bjaanes
    Rolf Bjaanes
    • 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?

    April 3rd, 2010 @ 07:13 PM

  8. José Valim
    José Valim
    • Assigned user set to José Valim

    Don't worry, I will apply the patch in both branches. :)

    April 3rd, 2010 @ 07:14 PM

  9. Rolf Bjaanes
    Rolf Bjaanes

    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! :)

    April 3rd, 2010 @ 07:29 PM

  10. Repository
    Repository
    • State changed from open to resolved

    April 5th, 2010 @ 11:23 PM

  11. José Valim
    José Valim
    • 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!

    April 5th, 2010 @ 11:26 PM

  12. Rolf Bjaanes
    Rolf Bjaanes

    I'll find time for it tomorrow or the day after.
    Crazy busy changing apartments :)

    Thanks btw :)
    This feel good.

    April 5th, 2010 @ 11:44 PM

  13. Rolf Bjaanes
    Rolf Bjaanes

    A bit later than expected, but here it is.
    Patch with tests attached.

    April 8th, 2010 @ 09:07 PM

  14. José Valim
    José Valim
    • State changed from open to committed

    April 10th, 2010 @ 12:32 PM