On Apr 25, 4:03 pm, PsiPro <[email protected]> wrote: > Hello all, > > I have a single tableless class that is drawing information from an > oracle db and importing it into my local posgres database. > > This DataFetch class is not inherited from AR:Base, but I was hoping > to use some of the AR magic. Currently during initialization I am > running: > > @connection = ActiveRecord::Base.establish_connection :oracle_dev > > After the data is loaded (it works fine) I try to import it into my > local rails app by using the standard Model.find method, unfortunately > all of my models then start using this connection and the tables do > not exist. > > Is there a way I can get establish_connection to not hijack the > connections for the rest of my models?
If you call establish_connection on a specific ActiveRecord::Base subclass then the specified connection will only be used for that class (and its subclasses) Fred > > My research via the api docs seems to indicate that by using > estbalish_connection I am adding a connection to the oracle db to the > pool and later requests are pulling from that. > > Should I just go strait to a DBI interface? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

