Use best_in_place_if.
Rubocop style recommendations.