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.