[ruby] One line if statement not working