Refactor#3134
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61f92bcb4a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub fn #clear_method(mut self) -> Self { | ||
| #clear_parent_keys | ||
| self.#field_ident = sea_orm::ActiveBelongsTo::Set(None); |
There was a problem hiding this comment.
Restore FK clearing in optional belongs-to clearers
When an optional belongs-to relation is cleared, the generated clear_* method now only marks the relation as ActiveBelongsTo::Set(None) and no longer sets the nullable from column(s) to Set(None). The generated .update()/.save() path later compensates for this, but callers that convert or inspect the ActiveModelEx before using that path—e.g. ActiveModel::from(model_ex.clear_bakery()).update(db) or try_into_model()—will keep the old/NotSet FK while the relation says it is cleared, so the direct ActiveModel update will not detach the parent.
Useful? React with 👍 / 👎.
61f92bc to
4bcbebd
Compare
…sertions The removed PartialEq<Option<..>> impls meant `assert_eq!(rel, None)` on a BelongsTo<Option<Entity>> read field no longer compiles. Add an explicit `is_unloaded_or_not_found()` (true for Unloaded or Loaded(None), matching the old `== None` semantics) and use it in the entity-loader / active-model-ex tests.
🎉 Released In 2.0.0-rc.43 🎉Huge thanks for the contribution! |
No description provided.