I’m using the ePub formatted book, so I can’t give the best page number here. Roughly p.45 – “The First Refactor”
Noel Rappin is fleshing out the StatusReport model to make the “saving a status report that has a date doesn’t override” test.
His code reads
def set_status_date self.status_date = Date.today if status_date.nil? end
Instead, I expected to see
def set_status_date self.status_date = Date.today if self.status_date.nil? end
, but it works as-is. I must be missing something basic here.