diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-23 17:49:18 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-23 17:49:18 +0200 |
| commit | f993853db3e233f05a55de5ba2a87b77acf041aa (patch) | |
| tree | 0a28289ff471ab5853b22c2a68ed21ce4e0eb4ac /lib/tasks/node_actions.rake | |
| parent | 932d4a4be40587fa6d489eca16a1ef6d6f2936d1 (diff) | |
Record asset deltas at publish, with changed assets as participants
Diffstat (limited to 'lib/tasks/node_actions.rake')
| -rw-r--r-- | lib/tasks/node_actions.rake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tasks/node_actions.rake b/lib/tasks/node_actions.rake index c378db24..645315b5 100644 --- a/lib/tasks/node_actions.rake +++ b/lib/tasks/node_actions.rake | |||
| @@ -13,6 +13,7 @@ namespace :node_actions do | |||
| 13 | stale = NodeAction.where.not(:inferred_from => nil) | 13 | stale = NodeAction.where.not(:inferred_from => nil) |
| 14 | stale = stale.where(:node_id => ENV["NODE_ID"]) if ENV["NODE_ID"] | 14 | stale = stale.where(:node_id => ENV["NODE_ID"]) if ENV["NODE_ID"] |
| 15 | puts "Removing #{stale.count} previously inferred entries" | 15 | puts "Removing #{stale.count} previously inferred entries" |
| 16 | ActionParticipant.where(:node_action => stale).delete_all | ||
| 16 | stale.delete_all | 17 | stale.delete_all |
| 17 | 18 | ||
| 18 | witnessed_creates = NodeAction.where(:action => "create", :inferred_from => nil).pluck(:node_id).to_set | 19 | witnessed_creates = NodeAction.where(:action => "create", :inferred_from => nil).pluck(:node_id).to_set |
| @@ -43,6 +44,7 @@ namespace :node_actions do | |||
| 43 | diff = NodeAction.head_diff(previous, page) | 44 | diff = NodeAction.head_diff(previous, page) |
| 44 | NodeAction.record!( | 45 | NodeAction.record!( |
| 45 | :node => node, :page => page, :user => page.editor, | 46 | :node => node, :page => page, :user => page.editor, |
| 47 | :participants => [node] + NodeAction.changed_assets(previous, page), | ||
| 46 | :action => "publish", | 48 | :action => "publish", |
| 47 | :occurred_at => page.updated_at, | 49 | :occurred_at => page.updated_at, |
| 48 | :inferred_from => "from_page_revision", | 50 | :inferred_from => "from_page_revision", |
