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

Ticket #8263: singularize_aves.diff

File singularize_aves.diff, 1.5 kB (added by jcinnamond, 3 years ago)

Fix to singularize 'aves' properly.

  • activesupport/test/inflector_test.rb

    old new  
    3131    "index"       => "indices", 
    3232 
    3333    "wife"        => "wives", 
    34     "safe"        => "saves", 
    3534    "half"        => "halves", 
     35    "wharf"       => "wharves", 
    3636 
     37    "shave"       => "shaves", 
     38    "save"        => "saves", 
     39    "safe"        => "safes", # If you treat safe as a noun 
     40 
    3741    "move"        => "moves", 
    3842 
    3943    "salesperson" => "salespeople", 
  • activesupport/lib/active_support/inflections.rb

    old new  
    88  inflect.plural(/(buffal|tomat)o$/i, '\1oes') 
    99  inflect.plural(/([ti])um$/i, '\1a') 
    1010  inflect.plural(/sis$/i, 'ses') 
    11   inflect.plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves') 
     11  inflect.plural(/(?:([^fa])fe|([lr])f)$/i, '\1\2ves') 
    1212  inflect.plural(/(hive)$/i, '\1s') 
    1313  inflect.plural(/([^aeiouy]|qu)y$/i, '\1ies') 
    1414  inflect.plural(/(x|ch|ss|sh)$/i, '\1es') 
     
    4141  inflect.singular(/(vert|ind)ices$/i, '\1ex') 
    4242  inflect.singular(/(matr)ices$/i, '\1ix') 
    4343  inflect.singular(/(quiz)zes$/i, '\1') 
     44  inflect.singular(/aves$/i, 'ave') 
    4445 
    4546  inflect.irregular('person', 'people') 
    4647  inflect.irregular('man', 'men')