-
Notifications
You must be signed in to change notification settings - Fork 187
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
Deleting a PolicyGroup does not delete its associated attachments #3858
Comments
Having just thought about this a bit more, I'm not sure the attachments should be marked as deleted when a policy group is deleted. A policy group is immediately public when it is created. Similarly attachments on a policy group are immediately public when they are added to the policy group. If we think of policy group creation as the equivalent of the publishing of an edition, and policy group destruction as the equivalent of the un-publishing of an edition, it could be argued that the attachments should stay visible when the policy group is destroyed. Or at least the attachment URLs should still do something sensible, e.g. redirect to some kind of "un-publishing page". It looks as if policy groups are published via the Publishing API, so perhaps there is a mechanism to display some kind of "un-publishing page" when a policy group is destroyed. Anyway, I'm not planning to look into this any further at this stage. |
This is inconsistent with what happens when you discard a draft edition. In that case, all the edition's attachments are marked as deleted and they are no longer visible, even in the draft stack:
Admin::EditionsController
has a#destroy
actionEditionDeleter
which has a#fire_transition!
method which, in turn, callsAttachable#delete_all_attachments
which marks the attachments asdeleted
deleted
flag is used to decide whether anAttachmentData
should be visibleConversely:
Admin::PolicyGroupsController
has a#destroy
actionPolicyGroup
model has no custom attachment-related behaviour other than that added byAttachable
Attachable
doesn't have any callbacks which would mark attachments as deletedThe text was updated successfully, but these errors were encountered: