transform arrays from rails4 and type_cast_code too