# Model's table names

**URL:** <https://www.ruby-forum.com/t/models-table-names/56989>\
**Category:** Engines\
**Created:** [April 6, 2006, 10:43am UTC](https://www.ruby-forum.com/t/models-table-names/56989 "2006-04-06T10:43:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 6, 2006, 10:43am UTC](https://www.ruby-forum.com/t/models-table-names/56989/1 "2006-04-06T10:43:38Z")

</div>

Hello, I would like to have all the tables referenced by my engine  
prefixed with “something”

I can’t use the set\_table\_name function because unfortunately this break  
fixtures usage (fixtures are not found if fixture name != model name !=  
table name)

I’ve tried to have a look inside engines code but I’m not (yet ;-)) able  
to touch something without the risk of injecting bugs.

is there a patch somewhere ?

Thanks

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 6, 2006, 10:57am UTC](https://www.ruby-forum.com/t/models-table-names/56989/2 "2006-04-06T10:57:51Z")

</div>

There is _preliminary_ support (see  
ActiveRecord::Base#wrapped\_table\_name) for prefixes in the latest  
(1.1) release of the Engines plugin, although I’m not sure how they’ll  
interact with the fixtures method. One thing to bear in mind is that  
the testing extensions provided with Engines let you specify the class  
and table names for your fixtures (see the login/user engines for an  
example of one way to achieve this, although I don’t believe that what  
I’ve done there is perfect).

However, as I said at the start, support is basic at the moment - the  
relevant ticket is [http://dev.rails-engines.org/tickets/67](http://dev.rails-engines.org/tickets/67), if you can  
contribute in any way, please re-open it and add your debug  
info/patches there.

It’s a bit of a tangled web with prefixes, migrations and fixtures all  
influencing the right table name and affecting the class inference  
mechanisms.

My best advice is to go ahead and change the engines code until you  
have something you feel works, and then submit the diff as a patch,  
where it will be double-checked and tested 🙂

- james

On 4/6/06, Nuno [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> is there a patch somewhere ?
> 
> Thanks
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> engine-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 6, 2006, 12:07pm UTC](https://www.ruby-forum.com/t/models-table-names/56989/3 "2006-04-06T12:07:01Z")

</div>

James A. wrote:

> There is _preliminary_ support (see  
> ActiveRecord::Base#wrapped\_table\_name) for prefixes in the latest  
> (1.1) release of the Engines plugin, although I’m not sure how they’ll  
> interact with the fixtures method. One thing to bear in mind is that  
> the testing extensions provided with Engines let you specify the class  
> and table names for your fixtures (see the login/user engines for an  
> example of one way to achieve this, although I don’t believe that what  
> I’ve done there is perfect).

I’ve had a look to these source files, seems to be fine for me… I’ll  
give it a try

> My best advice is to go ahead and change the engines code until you  
> have something you feel works, and then submit the diff as a patch,  
> where it will be double-checked and tested 🙂

Ahem, why not ? But I’ve not finished the 1st chapter of “Ruby for the  
Super Super newbies” 🙂
