• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

singular or plural names

 
Suganya Ram
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When should I use singular or plural names
Why does Rails do pluralization
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Suganya Ram:
When should I use singular or plural names?

When appropriate.

Originally posted by Suganya Ram:
Why does Rails do pluralization?

Because it's more natural to talk about "an account" when you're referring to an object and "accounts" when you're talking about the database table that those objects are stored in. It just makes sense.

In fact, I can't remember anyone suggesting that we should name the database table as "account" in such a scenario. The Rails developers have just made that universal default a default in the framework, too. If you don't like that default, you can override it (but things are a lot easier if you follow the convention).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic