# Pluralization issue? (taxes/taxis)

**URL:** <https://www.ruby-forum.com/t/pluralization-issue-taxes-taxis/57678>\
**Category:** Rails\
**Created:** [April 12, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/pluralization-issue-taxes-taxis/57678 "2006-04-12T22:53:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [April 12, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/pluralization-issue-taxes-taxis/57678/1 "2006-04-12T22:53:07Z")

</div>

Hi all,

Here’s an odd one. I have a “Tax” model which is related via a habtm  
relationship to a “Storefront” model. In my view\_store rhtml file, I  
have the line :

@storefront.taxes.each do |tax|

This line returns the following error:

NameError in Admin#view\_store

Showing app/views/admin/view\_store.rhtml where line #52 raised:

uninitialized constant Taxis

See that? “Taxes” has become “Taxis”. Since I am not trying to attach a  
Yellow Cab to my customers’ orders, I don’t want that. A search of the  
whole Rails app turns up no instances of the string “taxi” anywhere.  
Therefore I suspect an oddball pluralization.

From the console, “taxi”.pluralize returns “taxis”, and “tax”.pluralize  
returns “taxes”, so they look right. Just to be safe, I redeclared those  
plurals explicitly in my environment.rb. Still no dice.

I am at a loss, so I am throwing it out to y’all in the hopes someone  
might have stumbled across this issue.

thanks,

Michael.

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [April 13, 2006, 12:11am UTC](https://www.ruby-forum.com/t/pluralization-issue-taxes-taxis/57678/2 "2006-04-13T00:11:38Z")

</div>

Solved it!

> From the console, “taxi”.pluralize returns “taxis”, and “tax”.pluralize  
> returns “taxes”, so they look right. Just to be safe, I redeclared those  
> plurals explicitly in my environment.rb. Still no dice.

Apparently the singular -\> plural and plural -\> singular conversions are  
not the same thing, so adding the singularize directives fixed the  
problem:

Inflector.inflections do |inflect|  
inflect.plural ‘tax’, ‘taxes’  
inflect.plural ‘taxi’, ‘taxis’  
inflect.singular ‘taxes’, ‘tax’  
inflect.singular ‘taxis’, ‘taxi’  
end

Rails must think that “taxi” is the singular of “taxes” by default.

- mL.
