It looks a bit like lying that `latest_comment_id` is 0 when there is no `latest_comment`. It might be better that `latest_comment_id` is `nil`. In this case, you could substitute the `if` with `latest_comment_id = latest_comment.try(:id)` (that returns `nil` if `latest_comment` is `nil`).