fix case-when sytax error for ruby 2.x/1.9