Fix an error on rails 3.x environment