Cool Dates

I love discovering neat tricks with Ruby and Rails, even though most times I feel like the slow kid getting the joke 15 minutes after it was told.

This just makes my day.

>> (5.days.from_now.to_date - 1.day.ago.to_date).to_i
=> 6