Railroad and models without tables

2 views
Skip to first unread message

Milo Thurston

unread,
Jul 2, 2009, 6:26:39 AM7/2/09
to rubyonra...@googlegroups.com
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.
--
Posted via http://www.ruby-forum.com/.

Reply all
Reply to author
Forward
0 new messages