I find myself often writing statements equivalent to:
deleted_at = Time.at(data[:deleted_at]) if !data[:deleted_at].nil?
i'd like to be able to write this in a more concise way. Any suggestions?
Sometimes I write this as:
deleted_at = Time.at(i) if !(i = data[:deleted_at]).nil?
But I think this makes the code harder to read so I hope there is some nicer way to do this.