From d16161eab9029a509951146b80334c304c35fd34 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 9 Aug 2026 03:35:48 +0200 Subject: Refuse destroying an asset that is still attached --- app/models/node_action.rb | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'app/models/node_action.rb') diff --git a/app/models/node_action.rb b/app/models/node_action.rb index 1e64861e..aab1d238 100644 --- a/app/models/node_action.rb +++ b/app/models/node_action.rb @@ -82,22 +82,13 @@ class NodeAction < ApplicationRecord # "asset_create" (witnessed upload; participants: the asset alone): # "asset_name", "content_type", "path" -- flat strings # - # "asset_attach" (out-of-band attach via Node#attach_asset!; written - # only when at least one new join was created, per the tandem rule -- - # in-editor curation stays draft-scoped and surfaces at publish. - # participants: the node (primary) and the asset): - # "asset_name", "path" -- flat strings - # "headline" -- boolean, only when set by this attach - # - # "asset_destroy" (witnessed asset deletion; always written, even for - # unattached assets -- the files were publicly reachable; node column - # nil, subjects via participants: the asset plus every then-attached - # node): - # "asset_name" -- flat string - # "content_type" -- flat string - # "path" -- public original path, flat string - # "detached_from" -- array of unique_names, only when any - # "headline_removed_from" -- array of unique_names, only when any + # "asset_destroy" (witnessed asset deletion; the files were publicly + # reachable, so an entry is always written. Destruction is refused + # while the asset is attached to any current row, so no node is ever + # affected: node column nil, the asset the sole participant): + # "asset_name" -- flat string + # "content_type" -- flat string + # "path" -- public original path, flat string # # "otp_enroll" / "otp_disable" / "otp_reset" (second-factor # lifecycle) and "user_create" / "user_deactivate" / -- cgit v1.3