# Pluralization

**URL:** <https://www.ruby-forum.com/t/pluralization/89153>\
**Category:** Rails\
**Created:** [March 17, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/pluralization/89153 "2007-03-17T21:32:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 17, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/pluralization/89153/1 "2007-03-17T21:32:21Z")

</div>

IÂ´m aware that Pluralization can be turned-off, but I was wondering why  
it was created … just a convention? wouldnÂ´t it be easier if we  
followed a convention like models and tables in singular, but models  
with initial capped? ex: Person(class)/person(table)? … just curious  
…

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 17, 2007, 10:19pm UTC](https://www.ruby-forum.com/t/pluralization/89153/2 "2007-03-17T22:19:04Z")

</div>

Hi, I would say that it’s a rule that your model names are singlular  
and your table names are plural within rails. If you follow the rule  
set forth, then life is made easier. Also, it was design to be  
English like if you read the model’s associations.

Next, we don’t explicity reference the tables names within the models  
but we setup associations to other models using the proper syntax.

Finally, you’re free to use non-standard table names as well as turn  
off pluralization within rails.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 17, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/pluralization/89153/3 "2007-03-17T22:34:05Z")

</div>

Ken A. wrote:

I’m aware that Pluralization can be turned-off, but I was wondering why  
it  
was created … just a convention? wouldn´t it be easier if we followed  
a  
convention like models and tables in singular, but models with initial  
capped? ex: Person(class)/person(table)? … just curious

Firstly, Ruby requires constants, like class names, to begin with a  
capital  
letter, and other things not to.

Next, the best way to write a program is for a human to read. Any fool  
can  
write a program that a computer can read. Communicating with other  
humans is  
a major problem in all computing.

So consider the SQL statement CREATE TABLE users. Without regards to  
Rails,  
should that say ‘user’ or ‘users’? There are many users in the table.  
But  
you might write SELECT users.name, which looks odd (and not possessive).

So Rails splits this difference by attempting to match the plurality of  
a  
table name to its local context. User.find(:all) finds all users.  
belongs\_to  
:user links your table’s items to one user in the users table.  
has\_and\_belongs\_to\_many :users links your table items to many users in  
the  
users table. And so on.

The system is not perfect, but it leads one to consider - how literate  
could  
my own program be? Could I make my program literate, even at the level  
of  
statements’ grammar?

–  
Phlip  
[Redirecting...](http://www.greencheese.us/ZeekLand) ← NOT a blog!!!

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 17, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/pluralization/89153/4 "2007-03-17T22:38:29Z")

</div>

hi Phlip

ThatÂ´s a good explanation … so we have a more ‘semantic’ code and  
thatÂ´s good.

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 18, 2007, 5:44am UTC](https://www.ruby-forum.com/t/pluralization/89153/5 "2007-03-18T05:44:40Z")

</div>

David A. Black wrote:

> Method names can begin with a capital letter too. (Not a practice I’m  
> eager to encourage, but it’s possible 🙂

I thought when you call them, foo.Bar(), that’s when the interpretter  
trips over them.

–  
Phlip

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 17, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/pluralization/89153/6 "2007-03-17T22:39:06Z")

</div>

Hi –

On 3/17/07, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ken A. wrote:
> 
> I’m aware that Pluralization can be turned-off, but I was wondering why it  
> was created … just a convention? wouldn´t it be easier if we followed a  
> convention like models and tables in singular, but models with initial  
> capped? ex: Person(class)/person(table)? … just curious
> 
> Firstly, Ruby requires constants, like class names, to begin with a capital  
> letter, and other things not to.

Method names can begin with a capital letter too. (Not a practice I’m  
eager to encourage, but it’s possible 🙂

David

–  
Q. What is THE Ruby book for Rails developers?  
A. RUBY FOR RAILS by David A. Black ([http://www.manning.com/black](http://www.manning.com/black))  
(See what readers are saying! [http://www.rubypal.com/r4rrevs.pdf](http://www.rubypal.com/r4rrevs.pdf))  
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?  
A. Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 18, 2007, 9:22am UTC](https://www.ruby-forum.com/t/pluralization/89153/7 "2007-03-18T09:22:50Z")

</div>

On Mar 17, 2007, at 23:32, Ken A. wrote:

> I´m aware that Pluralization can be turned-off, but I was wondering why  
> it was created … just a convention? wouldn´t it be easier if we  
> followed a convention like models and tables in singular, but models  
> with initial capped? ex: Person(class)/person(table)? … just curious  
> …

[http://weblog.rubyonrails.com/2005/08/25/10-reasons-rails-does-](http://weblog.rubyonrails.com/2005/08/25/10-reasons-rails-does-)  
pluralization/

🙂

---

<div class="post-metadata">

**Author:** ![kena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e9bcb4/32.png) [@kena](https://www.ruby-forum.com/u/kena)\
**Post date:** [March 18, 2007, 1:22pm UTC](https://www.ruby-forum.com/t/pluralization/89153/8 "2007-03-18T13:22:12Z")

</div>

Hi –

On 3/18/07, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> David A. Black wrote:
> 
> > Method names can begin with a capital letter too. (Not a practice I’m  
> > eager to encourage, but it’s possible 🙂
> 
> I thought when you call them, foo.Bar(), that’s when the interpretter  
> trips over them.

No, they work:

$ ruby -e ‘a=“”; def a.X; 1; end; p a.X’  
1

David

–  
Q. What is THE Ruby book for Rails developers?  
A. RUBY FOR RAILS by David A. Black ([http://www.manning.com/black](http://www.manning.com/black))  
(See what readers are saying! [http://www.rubypal.com/r4rrevs.pdf](http://www.rubypal.com/r4rrevs.pdf))  
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?  
A. Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))
