# Regarding Database convention

**URL:** <https://www.ruby-forum.com/t/regarding-database-convention/93080>\
**Category:** Rails\
**Created:** [April 27, 2007, 8:57am UTC](https://www.ruby-forum.com/t/regarding-database-convention/93080 "2007-04-27T08:57:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![santoshat20007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/eada6e/32.png) [@santoshat20007](https://www.ruby-forum.com/u/santoshat20007)\
**Post date:** [April 27, 2007, 8:57am UTC](https://www.ruby-forum.com/t/regarding-database-convention/93080/1 "2007-04-27T08:57:24Z")

</div>

Hi,

I have a database which have table named with different convention, It  
is not following rubyonrails convention that table name must be pural.

How to create model for these table which will not follow convention.

please help me regarding this

---

<div class="post-metadata">

**Author:** ![santoshat20007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/eada6e/32.png) [@santoshat20007](https://www.ruby-forum.com/u/santoshat20007)\
**Post date:** [April 27, 2007, 9:33am UTC](https://www.ruby-forum.com/t/regarding-database-convention/93080/2 "2007-04-27T09:33:13Z")

</div>

Santosh R patil wrote:

> Hi,
> 
> I have a database which have table named with different convention, It  
> is not following rubyonrails convention that table name must be pural.
> 
> How to create model for these table which will not follow convention.
> 
> please help me regarding this

You can create model with script/generate model. Then in model:

class Foobar \< ActiveRecord::Base  
set\_table\_name “no\_conventional\_table\_name”  
set\_primary\_key “no\_conventional\_primary\_key\_id” # if needed  
end

Regards!
