Day 30

Tonight I was able to get much deeper into the ORM section. The curriculum returned to the lesson then lab format that is more familiar. Learn how to build a few methods and why you build them that way. Then immediately do it locally. Then the next lesson builds on the last. This is much easier to make progress through and I feel much better about databases now. Well, I feel much better about how they integrate and how Ruby wraps them. I’m on a lab entitled “Bringing It All Together” and it looks like there is a small section on Dynamic ORMs before I move into learning about ActiveRecord.

A spot where I got stuck for a bit was instantiating a new object using a Hash. This is something I had not done before and was not easily found via DuckDuckGo (yes my default search engine is not Google). So I ended up throwing some code I found into my file and it passed the test! Here it is:

def initialize(h)
  h.each {|k,v| public_send("#{k}=",v)}

I still had to make sure I had my attr_accessor‘s in place to pass my tests but that’s a pretty nifty piece of code I’ll be sure to save for later.

The same music library examples are being used and I’m having flashbacks to my Music Library CLI project that I completed with Mike. I can only imagine building that again utilizing a database. Hopefully, by the end of this DB section, I won’t feel as intimidated by such a task.

On a non-coding note. My youngest daughter hasn’t been getting up in the middle of the night to eat so now I’m being tasked with her first meal of the day because mommy is almost out the door at that time for work and doesn’t have time. This means I’m getting up at 6am pretty regularly right now. It’ll be nice if she starts sleeping until 7 or 8. If she keeps this up though I’m going to go back to a split coding day with some time in the morning and night.

Time spent today: 2:41
Time spent total: 130:22
Lessons completed today: 8
Lessons completed total: 318