You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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: