Phase 1 : Week 3 : Thursday
Database week has been killer. We drew a few schemas, coded them into ruby classes, put the classes into a sqlite3 database, and then... ActiveRecord entered our lives, in all it's Base class glory.
My pair and I had a very shallow understanding of ActiveRecord "magic", so our process was to first write a query using Sqlite3 syntax, find the corresponding Active Record syntax, and then refactor our ruby code into something reasonable.
I think my shining moment of today, was mentally separating the ruby parts from the AR parts, and writing a simple method that answered multiple count type questions.
Question 1: How many pink tulips are there? Question 2: How many perennials need full sunlight? def count(args) Flowers.where(args).count end count(:name => "Tulip", :color => "Pink") count(:bloom => "Perennial", :sun => "full")
Goal for this weekend: beef up knowledge of database relational models













