-
-
Notifications
You must be signed in to change notification settings - Fork 68
Delete library button added to library settings #3627
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 &ld 8000 quo;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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This a great start.
I've been thinking about this though, and we might need something more; I think this will delete models inside the library as well, it'll cascade. I think that's probably not what we want?
There are two possibilities for solving that:
- Only allow empty libraries to be deleted. This probably fixes most use cases for this where someone's put in the wrong path.
- Allow the models to be deleted along with the library, but prevent any filesystem-level changes. I think we'd want some tests to make sure that works.
What do you reckon?
Thank you for the feedback! Yes, you're right, we definitely need something more.
Yes, you're right. We don't want to remove the models inside the library and instead want to remove the models without a delete file operation. I think I'll need to make changes to the Model controller too to not delete the files if the library has been marked for deletion. Give me a few more days and I'll throw something together. I also need to write tests -- which I'm not very good at but I'll try. |
Update on this: #3786 and #3789 make improvements to file removal so that destroying database records never removes files, unless I'm going to pick up this PR now and finish it off, if you don't mind @matthewbadeau! |
1ba4330
to
fef08b8
Compare
fef08b8
to
0dff08c
Compare
Checklist
🚨 Please review the guidelines for contributing to this repository. 🚨
Warnings
Summary
This adds a delete button to the library edit page.
Linked issues
This should resolve #3595
Description of changes
This change adds a button to the library edit page.
It uses
if policy(@library).destroy?
similarly to how users can be deleted.