From 49a80c2f48531edc2a2719d77d3c5a8c111289dd Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 23 Jul 2026 03:58:14 +0200 Subject: Convert the log's node zoom to participants, completing subtree histories --- app/models/node.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models') diff --git a/app/models/node.rb b/app/models/node.rb index e92fa1ea..7a93e799 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -4,7 +4,14 @@ class Node < ApplicationRecord # Associations has_many :pages, -> { order("revision ASC") }, :dependent => :destroy + + # Entries where this node is the primary subject (fast-path column). + # For a *complete* history -- including subtree trash/destroy entries + # recorded at an ancestor -- use participated_actions instead. has_many :node_actions, :dependent => :nullify + has_many :action_participations, :class_name => "ActionParticipant", :as => :subject + has_many :participated_actions, :through => :action_participations, :source => :node_action + belongs_to :head, :class_name => "Page", :foreign_key => :head_id, optional: true belongs_to :draft, :class_name => "Page", :foreign_key => :draft_id, optional: true # Autosave pages carry no node_id, so has_many :pages does not cover -- cgit v1.3