# Help with table name pluralization

**URL:** <https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641>\
**Category:** Rails\
**Created:** [May 8, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641 "2007-05-08T19:53:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 8, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641/1 "2007-05-08T19:53:28Z")

</div>

I want to turn off table name pluralization, so I’ve added

ActiveRecord::Base.pluralize\_table\_names = false

at the end on my config/environment.rb

But I am getting an uninitialized constant error from paginator.

uninitialized constant Wherei

/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/  
dependencies.rb:266:in `load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:452:in`const\_missing’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/  
dependencies.rb:464:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ inflector.rb:250:in`constantize’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/  
core\_ext/string/inflections.rb:148:in `constantize' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ pagination.rb:195:in`paginator\_and\_collection\_for’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action\_controller/  
pagination.rb:130:in `paginate' app/controllers/admin_controller.rb:12:in`list’

My table name is ‘whereis’ and this seems to indicate that Rails is  
trying to get the model name by removing the plural from the table  
name.

It would be helpful to know how to test whether table name  
pluralization was turned off or whether I’ve missed a step it  
disabling pluralization. I have not any documentation on this.

Thanks  
Dave

---

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 8, 2007, 10:48pm UTC](https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641/2 "2007-05-08T22:48:51Z")

</div>

You did restart the server/console after modifying environment.rb  
right?

---

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 9, 2007, 1:09am UTC](https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641/3 "2007-05-09T01:09:13Z")

</div>

> My table name is ‘whereis’ and this seems to indicate that Rails is  
> trying to get the model name by removing the plural from the table  
> name.
> 
> It would be helpful to know how to test whether table name  
> pluralization was turned off or whether I’ve missed a step it  
> disabling pluralization. I have not any documentation on this.

Your change was for ActiveRecord table names only, It looks like from  
your stack trace that paginate is doing its own pluralizing. There’s  
no global “pluralization begone!” switch though.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 9, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641/4 "2007-05-09T18:12:55Z")

</div>

Yes, I did. Thanks.

---

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [May 9, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/help-with-table-name-pluralization/103641/5 "2007-05-09T18:21:56Z")

</div>

Good point! I’ve dumped the pagination. Thanks for the insight.

Dave
