# Railroad and models without tables

**URL:** <https://www.ruby-forum.com/t/railroad-and-models-without-tables/171429>\
**Category:** Rails\
**Created:** [July 2, 2009, 12:26pm UTC](https://www.ruby-forum.com/t/railroad-and-models-without-tables/171429 "2009-07-02T12:26:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![milo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://www.ruby-forum.com/u/milo)\
**Post date:** [July 2, 2009, 12:26pm UTC](https://www.ruby-forum.com/t/railroad-and-models-without-tables/171429/1 "2009-07-02T12:26:39Z")

</div>

I’d like to use railroad on my Rails model. Unfortunately, as I have to  
make some connections to a second database I’ve got some models like  
this:

class LegacyDb \< ActiveRecord::Base  
establish\_connection “legacy\_db”  
end

class LegacyDbData \< LegacyDb  
set\_table\_name “data”  
end

This is fine for the occasional call to the “data” table but railroad is  
not at all happy:

/usr/lib64/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/connection\_adapters/abstract\_adapter.rb:188:in  
`log': Mysql::Error: Table 'legacy_db.legacy_db_data' doesn't exist: SHOW FIELDS FROM`legacy\_db\_data` (ActiveRecord::StatementInvalid)

There are a few of these models and they’re used in various places so  
removing them for running railroad is not really possible. Is there a  
means of either preventing railroad from trying to connect to the main  
application database for these models?  
Thanks for any suggestions.
