Skip to content

Conversation

@pranav-g10
Copy link

This commit fixes issue #42

@joshed-io
Copy link
Owner

THanks @pranav-g10, this looks great. Is it possible to add a test case for when the restrict option is used?

The to_alize destroy callbacks used to be a after_destroy
callback which failed when relations specified a :nullify
dependency - since mongoid would nullify all relations before
the destroy and the after_destroy callback would find no children
after the destroy op to sync.

Changed the callback to be triggered before the destroy op, except
in the case of a :restrict dependency where a before_destroy callback
would pre-maturely sync the child objects even though the destroy op
may never happen
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.

2 participants