I used to work with a custom function that combined has_variable with != :undef but apparently (see link in commit) this should be the way to go.