Skip to content
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

Destroy transitions when resource id destroy #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

btrd
Copy link
Contributor

@btrd btrd commented Nov 27, 2019

Fix this issue #14

@seuros
Copy link
Member

seuros commented Nov 27, 2019

@btrd , Thank you for your PR.
I have some remarks about this change.
:destroy will load every single instance of the change and destroy them one by one.
If a record has thousands of changes , that could be a very expensive and slow process.
:delete_all will delete all the records with 1 SQL query.

The best approach i can think of now, is to delegate this to the database by have a constraint : on_delete: :cascade on the foreign key.

I still think we can add this feature if we can make it configurable.

@seuros
Copy link
Member

seuros commented Nov 27, 2019

The foreign key approach will work only in Relational databases. MongoDB will still need this IFAIK.

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.

3 participants