Cast value of an enum column as enum type; do nothing if `self` is not an enum. Will also transform `Array(Vec )` into `Json(Vec )` if the column type is `Json`.
(&self, val: Expr)
| 302 | /// Cast value of an enum column as enum type; do nothing if `self` is not an enum. |
| 303 | /// Will also transform `Array(Vec<Json>)` into `Json(Vec<Json>)` if the column type is `Json`. |
| 304 | fn save_enum_as(&self, val: Expr) -> SimpleExpr { |
| 305 | cast_enum_as(val, self, |col, enum_name, col_type| { |
| 306 | let type_name = match col_type { |
| 307 | ColumnType::Array(_) => { |
| 308 | Alias::new(format!("{}[]", enum_name.to_string())).into_iden() |
| 309 | } |
| 310 | _ => enum_name, |
| 311 | }; |
| 312 | col.as_enum(type_name) |
| 313 | }) |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | /// SeaORM's utility methods that act on [ColumnType] |
no test coverage detected