fix code not working in active_support 3.x