Rules::Maintainer
The generic maintainer: one algorithm that keeps every view's stored rows equal to its membership query.
Writes are raw SQL (bypassing the ORM) and wrapped in a transaction, so a collection is never observably a transient superset of its query.
Constants
Notifications produced imperatively. The batch reconcile leaves these untouched.
Instance methods
Classifies a relationship type by who maintains it, partitioning the
maintained-collection space so the batch reconcile never destroys a
row it does not own:
:registry-- a registered view; the batch reconcile owns it.:imperative-- a producer-written event record; left untouched.:error-- neither.
Rebuilds a view's stored rows to exactly equal its membership query.
Returns true if any rows changed, false otherwise.
Re-evaluates one key to an insert, delete, reposition, or no-op.
Fired after a base fact changes. Returns true if any rows
changed, false otherwise.
Re-evaluates a single view for a changed object, projecting the object to that view's affected key(s).
Returns the (view, owner) pairs that changed.
Re-evaluates every registered view for changed objects, projecting each object to each view's affected key(s) and reconciling each key exactly once.
Returns the (view, owner) pairs that changed.
Re-evaluates every registered view for changed objects, projecting each object to each view's affected key(s) and reconciling each key exactly once.
Returns the (view, owner) pairs that changed.
Yields once every view reflects the change.