# Fixtures using wrong database table

**URL:** <https://www.ruby-forum.com/t/fixtures-using-wrong-database-table/113048>\
**Category:** Rails\
**Created:** [August 26, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/fixtures-using-wrong-database-table/113048 "2007-08-26T23:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_JSBott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@Christopher\_JSBott](https://www.ruby-forum.com/u/Christopher_JSBott)\
**Post date:** [August 26, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/fixtures-using-wrong-database-table/113048/1 "2007-08-26T23:42:14Z")

</div>

Hello,

I have a model that sets it’s table\_name to something:  
MyModel \< ActiveRecord::Base  
self.table\_name = ‘some\_funky\_table’  
end

Now when I try to run the unit test for it:  
ruby tests/unit/my\_model\_test.rb

I get an error:  
relation “my\_models” does not exist

How can I get the fixtures to recognize that I’m using a model with an  
overridden table\_name attribute?

Thank you for the help.
