Skip to content

fix: new Sea ORM Enum type#248

Merged
lethib merged 1 commit into
mainfrom
fix/sea-orm-enum-type
Jul 1, 2026
Merged

fix: new Sea ORM Enum type#248
lethib merged 1 commit into
mainfrom
fix/sea-orm-enum-type

Conversation

@lethib

@lethib lethib commented Jul 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

@lethib lethib self-assigned this Jul 1, 2026
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Claude finished @lethib's task in 2m 24s —— View job


Review: PR #248 — fix: new Sea ORM Enum type

  • Gather context (PR diff, changed files)
  • Understand the request (code review)
  • Review src/models/_entities/sea_orm_active_enums.rs
  • Review src/models/user_business_informations.rs
  • Review src/views/user.rs
  • Check CI status
  • Post summary

Summary

This PR adapts Profession/PaymentMethod to sea-orm 2.0's native Enum representation (rs_type = "Enum" instead of "String"), and updates the two call sites that manually convert between Profession and a raw String (profession_enum() in user_business_informations.rs, and the serialization in views/user.rs) to go through sea_orm::sea_query::Enum { type_name, value } instead.

  • The change is scoped correctly: PaymentMethod is used elsewhere purely as a typed enum (via serde Serialize/Deserialize) and never manually converted to/from String, so no other call sites needed updating.
  • rust-checks (build/lint/fmt) and rust-tests both passed on CI, confirming the new Enum { type_name, value } construction and .to_value().value.into() extraction type-check correctly against sea-orm 2.0.0-rc.41.
  • No behavioral/logic regression: validation still happens via try_from_value, and the error message on invalid input is unchanged.

No security, performance, or correctness issues found. The only thing worth watching is that manually constructing sea_orm::sea_query::Enum { type_name: X::name().inner().into(), value: ... } at the call site is a bit of sea-orm internals leaking into model code — if a second enum (e.g. PaymentMethod) ever needs the same raw-string → enum conversion, this pattern will need to be duplicated. Not blocking for this fix.

@lethib
lethib merged commit 89e3889 into main Jul 1, 2026
5 checks passed
@lethib
lethib deleted the fix/sea-orm-enum-type branch July 1, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant