I've decided to make TZInfo raise an exception when passed a nil time (this is now implemented on the master branch). On balance, I think it is better to be explicit about handling nil values.
As for keeping the code elegant, you could add a method to the Time class in your project and then use it along with the safe navigation (&.) operator. For example:
I would expect:
Because the time difference of nothing is nothing.
Used in code, it goes like:
which consequently requires a
if Object.updated_at
appended, which is IMHO less elegant.The text was updated successfully, but these errors were encountered: