Rubicizing

So far so good. In a fairly short amount of time I have an application with some basic functionality + user management (register, signin, email confirmations, etc). Very simple = very nice.

So far I’ve been leaning pretty heavily on:
Pick Axe – Especially Chapters 27 (Built-in Classes and Modules) & Chapter 28 (Standard Library). Those have been an _incredibly_ useful resource for finding that method that you just know must exist, but what’s the syntax?

Agile Web Development w/ RoR – Especially Chapter 14 & 15 (Active Record) and a little Chapter 19 (Action Mailer).

… and there’s one other, but I’ll save that for the grand finale…

Now that this things working, it’s time to break it. In my very first iteration I created the app with a single db, but in reality – it’s going to span two. Today I needed to figure out exactly how this is done. From what I read, this is something that is quite possible… but just isn’t all that straight forward.

Maybe saying that it “isn’t straight forward” isn’t really fair. What’s really the case is more that: It’s just so bloomin easy to work with a single database that you never actually stop to really learn how you’re using the single database. Instead you just change your _outrageously_ straight forward database.yml file and BAM, you’re running.

I’ve found multiple different solutions out there. Some of them really don’t sound appealing – or don’t really fit my needs. Some seem to be exactly what I want… then didn’t work for me, for one reason or another.

I’m to the point now where it’s working and it’s really quite clean. The only flaw (if it really is one) is that the model class is naming the database that it wants to use. How bad is that?… I really don’t mind it at all to tell the truth. I can certainly see an argument for moving it into the config though – which is possible as well… we’ll see if we take that route or not.

Where did I come across this solution, you might ask? I know the suspense has been killing you regarding my other resource… why, Rails Recipes of course.

Advertisements

2 Comments

Filed under Agile Software Dev, rails, Ruby, SQL

2 responses to “Rubicizing

  1. two points:
    * when are you getting that stuff in svn?
    * don’t ever use the term “rubicizing” again

  2. Hey Rob,

    Thanks for the commenticizing.

    I’ll probably commit this morning… definitely today. At this point I am using 2 DBs but still not the _right_ legacy db. In my first attempt here I just took one table from my DB and stuck it in a temp one so that I could verify that I could hit 2 at once.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s