Skip to content

MONGOID-5841 Don't auto-build if the parent is frozen #5999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jamis
Copy link
Contributor

@jamis jamis commented Jun 23, 2025

If a record is frozen (perhaps because it has just been destroyed), attempts to auto-build associations on it should return nil, instead of raising a mysterious FrozenError.

@jamis jamis requested a review from a team as a code owner June 23, 2025 20:38
@jamis jamis added the bug Fixes a bug, with no new features or broken compatibility label Jun 23, 2025
@jamis jamis requested a review from comandeo-mongo June 23, 2025 20:38
@johnnyshields
Copy link
Contributor

johnnyshields commented Jun 24, 2025

9ybp70

Instead you should remove the FrozenError, there's no reason for it--it's a silly relic from ActiveRecord.

A deleted document should be simply "a document which doesn't exist in the DB, but still exists in Ruby (and can be potentially re-inserted)."

@jamis
Copy link
Contributor Author

jamis commented Jun 26, 2025

MONGOID-5841 has been closed as "works as designed;" this PR is being closed without merging.

@jamis jamis closed this Jun 26, 2025
@jamis jamis deleted the 5841-fix-frozen-error branch June 26, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes a bug, with no new features or broken compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants