Either `unless defined?(@has_random) && !@has_random` or the original `if`.
I am not sure which is clearer.