summaryrefslogtreecommitdiff
path: root/app/models/node_action.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-09 03:35:48 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-09 03:35:48 +0200
commitd16161eab9029a509951146b80334c304c35fd34 (patch)
tree87dd7426389b0e27b31925dc28c76a442eb721b8 /app/models/node_action.rb
parent20c735b0c5a2db9b8984848253ad99332d6211a8 (diff)
Refuse destroying an asset that is still attached
Diffstat (limited to 'app/models/node_action.rb')
-rw-r--r--app/models/node_action.rb23
1 files changed, 7 insertions, 16 deletions
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
82 # "asset_create" (witnessed upload; participants: the asset alone): 82 # "asset_create" (witnessed upload; participants: the asset alone):
83 # "asset_name", "content_type", "path" -- flat strings 83 # "asset_name", "content_type", "path" -- flat strings
84 # 84 #
85 # "asset_attach" (out-of-band attach via Node#attach_asset!; written 85 # "asset_destroy" (witnessed asset deletion; the files were publicly
86 # only when at least one new join was created, per the tandem rule -- 86 # reachable, so an entry is always written. Destruction is refused
87 # in-editor curation stays draft-scoped and surfaces at publish. 87 # while the asset is attached to any current row, so no node is ever
88 # participants: the node (primary) and the asset): 88 # affected: node column nil, the asset the sole participant):
89 # "asset_name", "path" -- flat strings 89 # "asset_name" -- flat string
90 # "headline" -- boolean, only when set by this attach 90 # "content_type" -- flat string
91 # 91 # "path" -- public original path, flat string
92 # "asset_destroy" (witnessed asset deletion; always written, even for
93 # unattached assets -- the files were publicly reachable; node column
94 # nil, subjects via participants: the asset plus every then-attached
95 # node):
96 # "asset_name" -- flat string
97 # "content_type" -- flat string
98 # "path" -- public original path, flat string
99 # "detached_from" -- array of unique_names, only when any
100 # "headline_removed_from" -- array of unique_names, only when any
101 # 92 #
102 # "otp_enroll" / "otp_disable" / "otp_reset" (second-factor 93 # "otp_enroll" / "otp_disable" / "otp_reset" (second-factor
103 # lifecycle) and "user_create" / "user_deactivate" / 94 # lifecycle) and "user_create" / "user_deactivate" /