Justin Rudd’s Drivel

Open Source is Cool

April 15, 2007 · No Comments

Yesterday I say this -

I started looking into using ActiveRecord, but I couldn’t because once you associate a class with an adapter, it can only be used for that adapter. So I can’t use the same class for both Oracle and MySQL. I think you can call “establish_connection” multiple times, but I’m not sure what that does to the instances I’ve already got in memory. The docs don’t touch on that subject at all. And I’m not sure how much of the configuration I’d need out of the Rails “config” directory to actually get it to work.

This morning I started working on a solution. Digging through the ActiveRecord code and what not. After hacking (and I truly mean hacking) something up that works, I find Magic Multi-Connections via Loud Thinking.

This is way cleaner than anything I had. I bow down to the Ruby-Fu of Nic Williams.

This will teach me that others have probably already built what I need.

Categories: Programming · Ruby

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment