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

Fix - Prevent bulk delete action on resources with childs #1704

Open
wants to merge 4 commits into
base: 1.x
Choose a base branch
from

Conversation

lguichard
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Apr 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2024 8:08am

@alecritson
Copy link
Collaborator

Thanks @lguichard the only issue I can potentially see with this is calling the relationship like ->attributes->count() is going to lazy load them for each row which is going to result in quite a lot of heavy queries potentially.

Would it be more efficient to modify the query and load the count like $query->withCount(['attributes']) and then change the check to ->attributes_count instead?

@lguichard
Copy link
Contributor Author

@alecritson Thanks for the feedback. It was so obvious that I forgot it 😵‍💫

@alecritson
Copy link
Collaborator

@alecritson Thanks for the feedback. It was so obvious that I forgot it 😵‍💫

Thanks @lguichard I've made one little tweak to the statement logic, hopefully that's alright and makes sense :)

@glennjacobs glennjacobs added this to the v1.0 milestone May 6, 2024
@alecritson alecritson linked an issue May 10, 2024 that may be closed by this pull request
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.

Deleting a collection with child collections causes an error
3 participants