Displaying 4 results from an estimated 4 matches for "legacybase".
2006 Mar 09
3
How to copy between databases?
I want to copy data from one database to another using rails. But, it seems
that rails only will talk to one database at a time. Is there a way around
this?
Any help would be greatly appreciated.
--
Best Regards,
-Larry
"Work, work, work...there is no satisfactory alternative."
--- E.Taft Benson
-------------- next part --------------
An HTML attachment was scrubbed...
2006 Jun 14
1
compare items from 2 db
...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/.
2007 Apr 04
4
joining across databases in a find statement with include (legacy db)
Hi,
I have a legacy database ''old'' and a new database ''new'' which rails
uses. I set up models using old with establish_connection(old), and
this works well, except for include:
class OldModel < ActiveRecord::Base
establish_connection(old)
end
class NewModel < ActiveRecord::Base
has_one :old_model
end
a = OldModel.find :first
NewModel.find(:all,
2006 Apr 18
7
Connecting to multiple databases
...re is a table in your external database
called externals, choose a different name for your class to be on the safe
side." ===> I dont have such a table
Dave Thomas says at
http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/Connections.rdoc
"In general, you''d expect the LegacyBase class to map to a database
table called legacy_base. It would, if we ever tried to use it to
access data. But because we don''t, and because Rails only reflects on
the table the first time a data access occurs, we can safely create an
ActiveRecord class with no underlying database table.&qu...