Hello World. It's me, Ariel.
I Had NO Idea
Yesterday I said “ActiveRecord seems much more built out.” Talk about understatement of the CENTURY. And I thought Ruby was high level. HA! Basically, in ActiveRecord, if you can dream it, you can do it. (Sidenote: I always attributed that to Blades of Glory but apparently it’s from Walt Disney?)
ORM = Online Relationship Manager
Right? Or is it object-relational mapping? I forget. But that’s what we spent the day doing! It was actually pretty fun, albeit straightforward (not a bad thing!), to wrap our SQL queries/result sets in Ruby objects. Yes, there was a lot of redundant code and setting up 1 to 2 line methods that just looked things up on so-and-so table probably would get pretty tedious by the 3rd or 4th project, but as a first-time experience, think was a great intro to an ORM.
Prequel to the SQL
Yeah I couldn’t resist.
So today marked the first major subject shift we’ve had: Ruby to SQL! In some ways it was tough, because we now have to stop thinking about “methods” and “returns” and “objects” and replace that vocabulary with “clauses” and “select” and “tables”. For the most part it’s fairly straightforward (and when it’s straightforward, it’s REALLY straightforward–as my partner put it, it’s just English, almost), although more complex JOINs did prove a challenge, especially when a subquery just comes so much more naturally.