[Rails] compare items from 2 db

Dan Kirkwood
2006-06-14T00:44:54Z

I''ve dug thru docs, recipes, wiki, but haven''t found anything
quite like
what I''m trying to do..

I have 2 databases with the same tables and same models representing
them.  I want to get an item (of same name) from the 2 dbs for
comparison.  Now, each example of connecting to multiple dbs I''ve seen
(including from Rails Recipes and the wiki) assumes that you want
different models accessing the different databases.  How can I have the
same model access 2 different dbs at the same time?

I''ve looked at trying to subclass each model so the subclass can access
an alternate database (I''m using single-table inheritance, so that path
is out.).

I''ve also thought of using an abstract base class (similar to the
LegacyBase class mentioned in the wiki), but that won''t work because
then *all* items would access the alternate db..

Any pointers appreciated..  -dan

--
Posted via http://www.ruby-forum.com/.