# Naming conventions for models on older database?

**URL:** <https://www.ruby-forum.com/t/naming-conventions-for-models-on-older-database/87495>\
**Category:** Rails\
**Created:** [March 27, 2006, 8:30am UTC](https://www.ruby-forum.com/t/naming-conventions-for-models-on-older-database/87495 "2006-03-27T08:30:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [March 27, 2006, 8:30am UTC](https://www.ruby-forum.com/t/naming-conventions-for-models-on-older-database/87495/1 "2006-03-27T08:30:51Z")

</div>

Hi,

I am using RoR for my web development. But Database is already created  
(Older database) with its own table name without RoR Specificcations.  
Table names are:-  
blacklist\_patterns  
category  
comment  
moderation  
store  
vote

What will be names for models corresponding to my above tables? If I  
want to specify my own names to models? Can I do it? If yes then How?

Please tell me.  
Thanx in advance.  
Prash

---

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [March 27, 2006, 9:24am UTC](https://www.ruby-forum.com/t/naming-conventions-for-models-on-older-database/87495/2 "2006-03-27T09:24:31Z")

</div>

On 3/27/06, Prashant T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> vote
> 
> What will be names for models corresponding to my above tables? If I  
> want to specify my own names to models? Can I do it? If yes then How?

You can name your models however you wish, and use the  
“set\_table\_name” method to specify this.  
class Comment \< ActiveRecord::Base  
set\_table\_name ‘comment’  
end

One further piece of trickery: currently, your unit test fixtures need  
to be named after the actual table, rather than after the model.  
So, put your comment fixtures in comment.yml, and refer to them with  
‘fixtures :comment’
