paper_trail_diff 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +158 -0
- data/QUICKSTART.md +149 -79
- data/README.md +179 -1388
- data/docs/architecture.md +88 -0
- data/docs/performance.md +309 -0
- data/docs/reference.md +977 -0
- data/docs/testing.md +169 -0
- data/lib/paper_trail_diff/activity_belongs_to_event_applier.rb +2 -12
- data/lib/paper_trail_diff/activity_boundary.rb +20 -8
- data/lib/paper_trail_diff/activity_child_candidate_loader.rb +29 -0
- data/lib/paper_trail_diff/activity_collection_event_applier.rb +10 -7
- data/lib/paper_trail_diff/activity_collection_route_updater.rb +1 -11
- data/lib/paper_trail_diff/activity_event_record_normalizer.rb +4 -0
- data/lib/paper_trail_diff/activity_event_record_resolver.rb +66 -6
- data/lib/paper_trail_diff/activity_event_snapshot_refresher.rb +6 -4
- data/lib/paper_trail_diff/activity_grouping.rb +12 -0
- data/lib/paper_trail_diff/activity_history.rb +9 -3
- data/lib/paper_trail_diff/activity_relationship.rb +2 -0
- data/lib/paper_trail_diff/activity_root_snapshot_refresher.rb +1 -0
- data/lib/paper_trail_diff/activity_snapshot_sequence.rb +9 -2
- data/lib/paper_trail_diff/activity_timeline_builder.rb +39 -35
- data/lib/paper_trail_diff/activity_version_collector.rb +27 -18
- data/lib/paper_trail_diff/analysis.rb +9 -4
- data/lib/paper_trail_diff/analysis_batch.rb +28 -7
- data/lib/paper_trail_diff/association_traversal.rb +23 -0
- data/lib/paper_trail_diff/batch_boundary_resolver.rb +18 -26
- data/lib/paper_trail_diff/batch_safety.rb +55 -0
- data/lib/paper_trail_diff/batched_root_analyzer.rb +14 -5
- data/lib/paper_trail_diff/batched_root_versions.rb +10 -38
- data/lib/paper_trail_diff/branch_snapshot_refresher.rb +7 -8
- data/lib/paper_trail_diff/collection_comparator.rb +18 -20
- data/lib/paper_trail_diff/collection_identity_index.rb +8 -12
- data/lib/paper_trail_diff/deleted_analysis_batch.rb +94 -0
- data/lib/paper_trail_diff/direct_record_state_loader.rb +81 -0
- data/lib/paper_trail_diff/endpoint.rb +10 -0
- data/lib/paper_trail_diff/engine.rb +4 -2
- data/lib/paper_trail_diff/errors.rb +9 -0
- data/lib/paper_trail_diff/historical_association_reifier.rb +26 -1
- data/lib/paper_trail_diff/historical_filter.rb +176 -0
- data/lib/paper_trail_diff/historical_snapshot_store.rb +51 -35
- data/lib/paper_trail_diff/instrumentation.rb +2 -2
- data/lib/paper_trail_diff/nested_comparator.rb +39 -15
- data/lib/paper_trail_diff/paper_trail_adapter.rb +109 -55
- data/lib/paper_trail_diff/prepared_activity_index.rb +121 -0
- data/lib/paper_trail_diff/prepared_edge_loader.rb +11 -11
- data/lib/paper_trail_diff/prepared_history.rb +21 -30
- data/lib/paper_trail_diff/prepared_history_loader.rb +14 -2
- data/lib/paper_trail_diff/prepared_record_index.rb +102 -29
- data/lib/paper_trail_diff/prepared_snapshot_builder.rb +64 -0
- data/lib/paper_trail_diff/prepared_state_association_reader.rb +77 -0
- data/lib/paper_trail_diff/root_version_plan.rb +35 -3
- data/lib/paper_trail_diff/root_version_selection.rb +16 -5
- data/lib/paper_trail_diff/scoped_analysis.rb +17 -2
- data/lib/paper_trail_diff/scoped_analysis_builder.rb +47 -0
- data/lib/paper_trail_diff/scoped_root_selection.rb +106 -13
- data/lib/paper_trail_diff/snapshot.rb +14 -1
- data/lib/paper_trail_diff/snapshot_normalizer.rb +75 -40
- data/lib/paper_trail_diff/step.rb +10 -5
- data/lib/paper_trail_diff/stored_time_precision.rb +68 -0
- data/lib/paper_trail_diff/support.rb +13 -3
- data/lib/paper_trail_diff/time_activity_timeline_builder.rb +19 -7
- data/lib/paper_trail_diff/time_range.rb +21 -2
- data/lib/paper_trail_diff/time_version_range.rb +2 -16
- data/lib/paper_trail_diff/timeline_builder.rb +5 -4
- data/lib/paper_trail_diff/timeline_range.rb +29 -46
- data/lib/paper_trail_diff/timeline_snapshot_provider.rb +13 -2
- data/lib/paper_trail_diff/traversal.rb +1 -1
- data/lib/paper_trail_diff/version.rb +1 -1
- data/lib/paper_trail_diff/version_association_candidate_scope.rb +1 -1
- data/lib/paper_trail_diff/version_boundary.rb +48 -0
- data/lib/paper_trail_diff/version_query.rb +41 -0
- data/lib/paper_trail_diff/version_range.rb +10 -38
- data/lib/paper_trail_diff.rb +78 -42
- data/sig/generated/paper_trail_diff/activity_belongs_to_event_applier.rbs +0 -3
- data/sig/generated/paper_trail_diff/activity_boundary.rbs +9 -4
- data/sig/generated/paper_trail_diff/activity_child_candidate_loader.rbs +11 -0
- data/sig/generated/paper_trail_diff/activity_collection_event_applier.rbs +4 -4
- data/sig/generated/paper_trail_diff/activity_collection_route_updater.rbs +0 -3
- data/sig/generated/paper_trail_diff/activity_event_record_resolver.rbs +19 -3
- data/sig/generated/paper_trail_diff/activity_event_snapshot_refresher.rbs +2 -2
- data/sig/generated/paper_trail_diff/activity_grouping.rbs +3 -0
- data/sig/generated/paper_trail_diff/activity_history.rbs +6 -2
- data/sig/generated/paper_trail_diff/activity_snapshot_sequence.rbs +7 -2
- data/sig/generated/paper_trail_diff/activity_timeline_builder.rbs +8 -3
- data/sig/generated/paper_trail_diff/activity_version_collector.rbs +4 -8
- data/sig/generated/paper_trail_diff/analysis.rbs +2 -2
- data/sig/generated/paper_trail_diff/analysis_batch.rbs +14 -3
- data/sig/generated/paper_trail_diff/association_traversal.rbs +11 -0
- data/sig/generated/paper_trail_diff/batch_boundary_resolver.rbs +7 -10
- data/sig/generated/paper_trail_diff/batch_safety.rbs +24 -0
- data/sig/generated/paper_trail_diff/batched_root_analyzer.rbs +8 -2
- data/sig/generated/paper_trail_diff/batched_root_versions.rbs +4 -16
- data/sig/generated/paper_trail_diff/branch_snapshot_refresher.rbs +2 -2
- data/sig/generated/paper_trail_diff/collection_comparator.rbs +6 -3
- data/sig/generated/paper_trail_diff/collection_identity_index.rbs +3 -3
- data/sig/generated/paper_trail_diff/deleted_analysis_batch.rbs +44 -0
- data/sig/generated/paper_trail_diff/direct_record_state_loader.rbs +42 -0
- data/sig/generated/paper_trail_diff/endpoint.rbs +5 -0
- data/sig/generated/paper_trail_diff/engine.rbs +4 -2
- data/sig/generated/paper_trail_diff/errors.rbs +12 -0
- data/sig/generated/paper_trail_diff/historical_association_reifier.rbs +8 -0
- data/sig/generated/paper_trail_diff/historical_filter.rbs +75 -0
- data/sig/generated/paper_trail_diff/historical_snapshot_store.rbs +17 -4
- data/sig/generated/paper_trail_diff/nested_comparator.rbs +15 -7
- data/sig/generated/paper_trail_diff/paper_trail_adapter.rbs +36 -15
- data/sig/generated/paper_trail_diff/prepared_activity_index.rbs +56 -0
- data/sig/generated/paper_trail_diff/prepared_edge_loader.rbs +3 -3
- data/sig/generated/paper_trail_diff/prepared_history.rbs +12 -14
- data/sig/generated/paper_trail_diff/prepared_history_loader.rbs +2 -0
- data/sig/generated/paper_trail_diff/prepared_record_index.rbs +43 -6
- data/sig/generated/paper_trail_diff/prepared_snapshot_builder.rbs +24 -0
- data/sig/generated/paper_trail_diff/prepared_state_association_reader.rbs +33 -0
- data/sig/generated/paper_trail_diff/root_version_plan.rbs +22 -2
- data/sig/generated/paper_trail_diff/root_version_selection.rbs +8 -1
- data/sig/generated/paper_trail_diff/scoped_analysis.rbs +14 -2
- data/sig/generated/paper_trail_diff/scoped_analysis_builder.rbs +22 -0
- data/sig/generated/paper_trail_diff/scoped_root_selection.rbs +46 -6
- data/sig/generated/paper_trail_diff/snapshot.rbs +4 -0
- data/sig/generated/paper_trail_diff/snapshot_normalizer.rbs +34 -11
- data/sig/generated/paper_trail_diff/step.rbs +8 -2
- data/sig/generated/paper_trail_diff/stored_time_precision.rbs +36 -0
- data/sig/generated/paper_trail_diff/support.rbs +7 -0
- data/sig/generated/paper_trail_diff/time_activity_timeline_builder.rbs +7 -2
- data/sig/generated/paper_trail_diff/time_range.rbs +9 -0
- data/sig/generated/paper_trail_diff/time_version_range.rbs +0 -6
- data/sig/generated/paper_trail_diff/timeline_builder.rbs +2 -2
- data/sig/generated/paper_trail_diff/timeline_range.rbs +12 -15
- data/sig/generated/paper_trail_diff/timeline_snapshot_provider.rbs +2 -0
- data/sig/generated/paper_trail_diff/version_boundary.rbs +23 -0
- data/sig/generated/paper_trail_diff/version_query.rbs +21 -0
- data/sig/generated/paper_trail_diff/version_range.rbs +5 -14
- data/sig/generated/paper_trail_diff.rbs +31 -25
- metadata +31 -5
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Optional full/partial snapshot operations consumed by the activity sequence.
|
|
5
5
|
class ActivitySnapshotProvider
|
|
6
|
-
# : (snapshotter: untyped, refresher: untyped, preparer: untyped) -> void
|
|
7
|
-
def initialize: (snapshotter: untyped, refresher: untyped, preparer: untyped) -> void
|
|
6
|
+
# : (snapshotter: untyped, refresher: untyped, preparer: untyped, ?activity_index: untyped) -> void
|
|
7
|
+
def initialize: (snapshotter: untyped, refresher: untyped, preparer: untyped, ?activity_index: untyped) -> void
|
|
8
8
|
|
|
9
9
|
# : (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
10
10
|
def prepare: (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
@@ -18,6 +18,11 @@ module PaperTrailDiff
|
|
|
18
18
|
# : (untyped, untyped, RecordSnapshot?, event: ActivityEvent) -> RecordSnapshot?
|
|
19
19
|
def advance_root: (untyped, untyped, RecordSnapshot?, event: ActivityEvent) -> RecordSnapshot?
|
|
20
20
|
|
|
21
|
+
# : () -> PreparedActivityIndex?
|
|
22
|
+
def activity_index: () -> PreparedActivityIndex?
|
|
23
|
+
|
|
24
|
+
@activity_index: untyped
|
|
25
|
+
|
|
21
26
|
@preparer: untyped
|
|
22
27
|
|
|
23
28
|
@refresher: untyped
|
|
@@ -44,6 +44,14 @@ module PaperTrailDiff
|
|
|
44
44
|
# : () -> Array[ActivityStep]
|
|
45
45
|
def build_to_current: () -> Array[ActivityStep]
|
|
46
46
|
|
|
47
|
+
# : () -> Analysis
|
|
48
|
+
def analyze_current: () -> Analysis
|
|
49
|
+
|
|
50
|
+
# The explicit live endpoint and a batch's live closing endpoint use the
|
|
51
|
+
# same selected plan. A version filter can close earlier, on its successor.
|
|
52
|
+
# : () -> [RootVersionPlan, Array[ActivityEvent], ActivityHistory, RecordSnapshot?, ActivityBoundary?]
|
|
53
|
+
def current_history: () -> [ RootVersionPlan, Array[ActivityEvent], ActivityHistory, RecordSnapshot?, ActivityBoundary? ]
|
|
54
|
+
|
|
47
55
|
# : () -> [RecordSnapshot?, untyped]
|
|
48
56
|
def capture_current: () -> [ RecordSnapshot?, untyped ]
|
|
49
57
|
|
|
@@ -56,9 +64,6 @@ module PaperTrailDiff
|
|
|
56
64
|
# : (Array[untyped], ?end_at: untyped) -> void
|
|
57
65
|
def prepare_history: (Array[untyped], ?end_at: untyped) -> void
|
|
58
66
|
|
|
59
|
-
# : (Array[untyped], Array[ActivityEvent], ?current: untyped, ?final_boundary: ActivityBoundary?, ?final_snapshot: RecordSnapshot?) -> Array[ActivityStep]
|
|
60
|
-
def build_event_steps: (Array[untyped], Array[ActivityEvent], ?current: untyped, ?final_boundary: ActivityBoundary?, ?final_snapshot: RecordSnapshot?) -> Array[ActivityStep]
|
|
61
|
-
|
|
62
67
|
# Appends the transition into an explicit closing boundary, which is either
|
|
63
68
|
# a requested current record or the absence a final root destroy leaves.
|
|
64
69
|
# : (ActivityHistory, Array[ActivityEvent], ActivityBoundary?, RecordSnapshot?) -> Array[ActivityStep]
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Collects root and selected-descendant versions relevant to one root history range.
|
|
5
5
|
class ActivityVersionCollector
|
|
6
|
-
# : (untyped, root_versions: Array[untyped], tree: AssociationTree, traversal: AssociationTraversal, ?range_start: untyped, ?range_end: untyped) -> void
|
|
7
|
-
def initialize: (untyped, root_versions: Array[untyped], tree: AssociationTree, traversal: AssociationTraversal, ?range_start: untyped, ?range_end: untyped) -> void
|
|
6
|
+
# : (untyped, root_versions: Array[untyped], tree: AssociationTree, traversal: AssociationTraversal, ?range_start: untyped, ?range_end: untyped, ?prepared: PreparedActivityIndex?) -> void
|
|
7
|
+
def initialize: (untyped, root_versions: Array[untyped], tree: AssociationTree, traversal: AssociationTraversal, ?range_start: untyped, ?range_end: untyped, ?prepared: PreparedActivityIndex?) -> void
|
|
8
8
|
|
|
9
9
|
# : () -> Array[ActivityEvent]
|
|
10
10
|
def call: () -> Array[ActivityEvent]
|
|
11
11
|
|
|
12
12
|
private
|
|
13
13
|
|
|
14
|
+
@prepared: PreparedActivityIndex?
|
|
15
|
+
|
|
14
16
|
@range: ActivityRange
|
|
15
17
|
|
|
16
18
|
@record: untyped
|
|
@@ -58,11 +60,5 @@ module PaperTrailDiff
|
|
|
58
60
|
|
|
59
61
|
# : (untyped, untyped) -> untyped
|
|
60
62
|
def target_class: (untyped, untyped) -> untyped
|
|
61
|
-
|
|
62
|
-
# : (untyped) -> bool
|
|
63
|
-
def in_range?: (untyped) -> bool
|
|
64
|
-
|
|
65
|
-
# : (String, String) -> String
|
|
66
|
-
def join_path: (String, String) -> String
|
|
67
63
|
end
|
|
68
64
|
end
|
|
@@ -26,7 +26,7 @@ module PaperTrailDiff
|
|
|
26
26
|
# Reconstructed endpoint states are opt-in, because they carry the whole
|
|
27
27
|
# selected graph whether or not anything changed, which dwarfs the rest of
|
|
28
28
|
# the payload for a wide graph.
|
|
29
|
-
# : (?snapshots: bool) -> Hash[Symbol, untyped]
|
|
30
|
-
def to_h: (?snapshots: bool) -> Hash[Symbol, untyped]
|
|
29
|
+
# : (?snapshots: bool, ?metadata: bool) -> Hash[Symbol, untyped]
|
|
30
|
+
def to_h: (?snapshots: bool, ?metadata: bool) -> Hash[Symbol, untyped]
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -5,8 +5,8 @@ module PaperTrailDiff
|
|
|
5
5
|
# versions and preparing their association history once for the whole batch
|
|
6
6
|
# rather than once per root.
|
|
7
7
|
class AnalysisBatch
|
|
8
|
-
# : (Array[untyped], time_range: TimeRange?, live_loader: untyped, history_preparer: untyped, analyzer: untyped, ?version_scope: untyped, ?close_on_current: bool) -> void
|
|
9
|
-
def initialize: (Array[untyped], time_range: TimeRange?, live_loader: untyped, history_preparer: untyped, analyzer: untyped, ?version_scope: untyped, ?close_on_current: bool) -> void
|
|
8
|
+
# : (Array[untyped], time_range: TimeRange?, live_loader: untyped, history_preparer: untyped, analyzer: untyped, ?version_scope: untyped, ?close_on_current: bool, ?context_required: bool) -> void
|
|
9
|
+
def initialize: (Array[untyped], time_range: TimeRange?, live_loader: untyped, history_preparer: untyped, analyzer: untyped, ?version_scope: untyped, ?close_on_current: bool, ?context_required: bool) -> void
|
|
10
10
|
|
|
11
11
|
# : () -> Hash[identity, Analysis]
|
|
12
12
|
def call: () -> Hash[identity, Analysis]
|
|
@@ -17,6 +17,8 @@ module PaperTrailDiff
|
|
|
17
17
|
|
|
18
18
|
@close_on_current: bool
|
|
19
19
|
|
|
20
|
+
@context_required: bool
|
|
21
|
+
|
|
20
22
|
@history_preparer: untyped
|
|
21
23
|
|
|
22
24
|
@live_loader: untyped
|
|
@@ -43,8 +45,17 @@ module PaperTrailDiff
|
|
|
43
45
|
# : (Array[untyped], Hash[Array[String], RootVersionPlan], Hash[Array[String], untyped]) -> void
|
|
44
46
|
def prepare: (Array[untyped], Hash[Array[String], RootVersionPlan], Hash[Array[String], untyped]) -> void
|
|
45
47
|
|
|
48
|
+
# : (Array[untyped], Hash[Array[String], RootVersionPlan]) -> bool
|
|
49
|
+
def closes_live?: (Array[untyped], Hash[Array[String], RootVersionPlan]) -> bool
|
|
50
|
+
|
|
51
|
+
# A plan closing on the live record reads history up to now; the others
|
|
52
|
+
# stop at the window, so a past window does not load everything since.
|
|
53
|
+
# : (Array[untyped], ?live: bool) -> Hash[Symbol, untyped]
|
|
54
|
+
def preparation_range: (Array[untyped], ?live: bool) -> Hash[Symbol, untyped]
|
|
55
|
+
|
|
46
56
|
# A root with no versions in range has nothing to report, which is an empty
|
|
47
|
-
# result rather than a failed request
|
|
57
|
+
# result rather than a failed request -- unless an activity view closes it
|
|
58
|
+
# on current state, where its descendants may still have moved.
|
|
48
59
|
# : (untyped, RootVersionPlan) -> Analysis
|
|
49
60
|
def analysis_for: (untyped, RootVersionPlan) -> Analysis
|
|
50
61
|
end
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Resolves and validates ActiveRecord reflections for a bounded association tree.
|
|
5
5
|
class AssociationTraversal
|
|
6
|
+
# The class a `belongs_to` points at for this record, reading a polymorphic
|
|
7
|
+
# type column when there is one. Nil when that type names no class.
|
|
8
|
+
# : (untyped, untyped) -> untyped
|
|
9
|
+
def self.belongs_to_target: (untyped, untyped) -> untyped
|
|
10
|
+
|
|
6
11
|
# : (AssociationTree) -> void
|
|
7
12
|
def initialize: (AssociationTree) -> void
|
|
8
13
|
|
|
@@ -18,6 +23,12 @@ module PaperTrailDiff
|
|
|
18
23
|
# : (untyped) -> Array[String]
|
|
19
24
|
def habtm_paths: (untyped) -> Array[String]
|
|
20
25
|
|
|
26
|
+
# HABTM join rows have no versions of their own, so membership changes
|
|
27
|
+
# cannot be split into events once a range runs past the last root version
|
|
28
|
+
# into live state.
|
|
29
|
+
# : (untyped) -> void
|
|
30
|
+
def reject_live_habtm_activity!: (untyped) -> void
|
|
31
|
+
|
|
21
32
|
# : (untyped, AssociationTree, path: String) -> Array[untyped]
|
|
22
33
|
def reflections_for: (untyped, AssociationTree, path: String) -> Array[untyped]
|
|
23
34
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated from lib/paper_trail_diff/batch_boundary_resolver.rb with RBS::Inline
|
|
2
2
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
|
-
# Resolves `:first`
|
|
4
|
+
# Resolves `:first` endpoints for a whole batch in a fixed number of queries per
|
|
5
5
|
# model class. Left to the caller this is a per-root lookup, which reintroduces
|
|
6
6
|
# exactly the queries a batched comparison exists to remove.
|
|
7
7
|
class BatchBoundaryResolver
|
|
@@ -46,15 +46,12 @@ module PaperTrailDiff
|
|
|
46
46
|
# : (Hash[Array[String], Hash[Symbol, untyped]], untyped, Array[untyped]) -> void
|
|
47
47
|
def add_model_boundaries: (Hash[Array[String], Hash[Symbol, untyped]], untyped, Array[untyped]) -> void
|
|
48
48
|
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
# string form rather than assuming integers.
|
|
56
|
-
# : (Hash[untyped, untyped], untyped) -> untyped
|
|
57
|
-
def boundary_key: (Hash[untyped, untyped], untyped) -> untyped
|
|
49
|
+
# Each root's earliest version by time, in one query whatever the size of
|
|
50
|
+
# the batch. The lowest id is not the earliest version when ids are not
|
|
51
|
+
# sequential, as with UUIDs, so time decides and the usual ordering breaks
|
|
52
|
+
# a tie -- refusing one that ids cannot order.
|
|
53
|
+
# : (untyped, Array[untyped]) -> Hash[String, untyped]
|
|
54
|
+
def first_versions: (untyped, Array[untyped]) -> Hash[String, untyped]
|
|
58
55
|
|
|
59
56
|
# : (untyped, untyped) -> Array[String]
|
|
60
57
|
def identity_key: (untyped, untyped) -> Array[String]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated from lib/paper_trail_diff/batch_safety.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module PaperTrailDiff
|
|
4
|
+
# Refuses known per-record association loading before a batch reconstructs it.
|
|
5
|
+
class BatchSafety
|
|
6
|
+
# : (AssociationTraversal, allow_expensive: bool) -> void
|
|
7
|
+
def initialize: (AssociationTraversal, allow_expensive: bool) -> void
|
|
8
|
+
|
|
9
|
+
# : (untyped, ?historical: bool) -> void
|
|
10
|
+
def call: (untyped, ?historical: bool) -> void
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
@allow_expensive: bool
|
|
15
|
+
|
|
16
|
+
@traversal: AssociationTraversal
|
|
17
|
+
|
|
18
|
+
# : (untyped, String, bool) -> void
|
|
19
|
+
def check: (untyped, String, bool) -> void
|
|
20
|
+
|
|
21
|
+
# : (untyped, bool) -> String?
|
|
22
|
+
def reason_for: (untyped, bool) -> String?
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -4,8 +4,8 @@ module PaperTrailDiff
|
|
|
4
4
|
# Builds one root's Analysis inside a batch, from versions the batch already
|
|
5
5
|
# selected and history it already prepared.
|
|
6
6
|
class BatchedRootAnalyzer
|
|
7
|
-
# : (tree: AssociationTree, timeline_snapshotter: untyped, activity_snapshotter: untyped, preparer: untyped, activity: bool) -> void
|
|
8
|
-
def initialize: (tree: AssociationTree, timeline_snapshotter: untyped, activity_snapshotter: untyped, preparer: untyped, activity: bool) -> void
|
|
7
|
+
# : (tree: AssociationTree, timeline_snapshotter: untyped, activity_snapshotter: untyped, preparer: untyped, activity: bool, ?within: untyped, ?snapshots: bool, ?group: Symbol?) -> void
|
|
8
|
+
def initialize: (tree: AssociationTree, timeline_snapshotter: untyped, activity_snapshotter: untyped, preparer: untyped, activity: bool, ?within: untyped, ?snapshots: bool, ?group: Symbol?) -> void
|
|
9
9
|
|
|
10
10
|
# : (untyped, RootVersionPlan) -> Analysis
|
|
11
11
|
def call: (untyped, RootVersionPlan) -> Analysis
|
|
@@ -16,12 +16,18 @@ module PaperTrailDiff
|
|
|
16
16
|
|
|
17
17
|
@activity_snapshotter: untyped
|
|
18
18
|
|
|
19
|
+
@group: Symbol?
|
|
20
|
+
|
|
19
21
|
@preparer: untyped
|
|
20
22
|
|
|
23
|
+
@snapshots: bool
|
|
24
|
+
|
|
21
25
|
@timeline_snapshotter: untyped
|
|
22
26
|
|
|
23
27
|
@tree: AssociationTree
|
|
24
28
|
|
|
29
|
+
@within: untyped
|
|
30
|
+
|
|
25
31
|
# : (untyped, RootVersionPlan) -> Analysis
|
|
26
32
|
def activity_analysis: (untyped, RootVersionPlan) -> Analysis
|
|
27
33
|
end
|
|
@@ -5,8 +5,8 @@ module PaperTrailDiff
|
|
|
5
5
|
# queries. Only the range forms that mean the same thing for every root are
|
|
6
6
|
# supported: a shared wall-clock window, or each root's own whole history.
|
|
7
7
|
class BatchedRootVersions
|
|
8
|
-
# : (Array[untyped], time_range: TimeRange?, ?version_scope: untyped, ?live_endpoints: Hash[Array[String], untyped]?) -> void
|
|
9
|
-
def initialize: (Array[untyped], time_range: TimeRange?, ?version_scope: untyped, ?live_endpoints: Hash[Array[String], untyped]?) -> void
|
|
8
|
+
# : (Array[untyped], time_range: TimeRange?, ?version_scope: untyped, ?live_endpoints: Hash[Array[String], untyped]?, ?context_required: bool) -> void
|
|
9
|
+
def initialize: (Array[untyped], time_range: TimeRange?, ?version_scope: untyped, ?live_endpoints: Hash[Array[String], untyped]?, ?context_required: bool) -> void
|
|
10
10
|
|
|
11
11
|
# Returns a plan per record identity.
|
|
12
12
|
# : () -> Hash[Array[String], RootVersionPlan]
|
|
@@ -14,6 +14,8 @@ module PaperTrailDiff
|
|
|
14
14
|
|
|
15
15
|
private
|
|
16
16
|
|
|
17
|
+
@context_required: bool
|
|
18
|
+
|
|
17
19
|
@live_endpoints: Hash[Array[String], untyped]?
|
|
18
20
|
|
|
19
21
|
@records: Array[untyped]
|
|
@@ -47,23 +49,9 @@ module PaperTrailDiff
|
|
|
47
49
|
# : (untyped, Array[untyped], TimeRange?) -> untyped
|
|
48
50
|
def range_scope: (untyped, Array[untyped], TimeRange?) -> untyped
|
|
49
51
|
|
|
50
|
-
# One row per root: the earliest version after the window, found without a
|
|
51
|
-
# window function so the query stays portable.
|
|
52
52
|
# : (untyped, Array[untyped], TimeRange) -> Hash[String, untyped]
|
|
53
53
|
def trailing_versions: (untyped, Array[untyped], TimeRange) -> Hash[String, untyped]
|
|
54
54
|
|
|
55
|
-
# : (untyped, TimeRange) -> untyped
|
|
56
|
-
def no_earlier_trailing: (untyped, TimeRange) -> untyped
|
|
57
|
-
|
|
58
|
-
# Mirrors the window's own end handling, so a version sitting exactly on an
|
|
59
|
-
# inclusive boundary stays inside the window instead of masking the trailing
|
|
60
|
-
# version that follows it.
|
|
61
|
-
# : (untyped, untyped, TimeRange) -> untyped
|
|
62
|
-
def preceding: (untyped, untyped, TimeRange) -> untyped
|
|
63
|
-
|
|
64
|
-
# : (untyped, TimeRange) -> untyped
|
|
65
|
-
def after_window: (untyped, TimeRange) -> untyped
|
|
66
|
-
|
|
67
55
|
# : (untyped, Array[untyped]) -> untyped
|
|
68
56
|
def base_scope: (untyped, Array[untyped]) -> untyped
|
|
69
57
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Reconstructs selected root branches and merges them into a prior immutable snapshot.
|
|
5
5
|
class BranchSnapshotRefresher
|
|
6
|
-
# : (tree: AssociationTree, ignore_policy: IgnorePolicy, traversal: AssociationTraversal, pool: SnapshotPool, normalizer: SnapshotNormalizer, full_snapshotter: untyped, partial_snapshotter: untyped, association_reader: untyped, record_transition: untyped) -> void
|
|
7
|
-
def initialize: (tree: AssociationTree, ignore_policy: IgnorePolicy, traversal: AssociationTraversal, pool: SnapshotPool, normalizer: SnapshotNormalizer, full_snapshotter: untyped, partial_snapshotter: untyped, association_reader: untyped, record_transition: untyped) -> void
|
|
6
|
+
# : (tree: AssociationTree, ignore_policy: IgnorePolicy, traversal: AssociationTraversal, pool: SnapshotPool, normalizer: SnapshotNormalizer, full_snapshotter: untyped, partial_snapshotter: untyped, association_reader: untyped, record_transition: untyped, ?prepared_record_after: untyped) -> void
|
|
7
|
+
def initialize: (tree: AssociationTree, ignore_policy: IgnorePolicy, traversal: AssociationTraversal, pool: SnapshotPool, normalizer: SnapshotNormalizer, full_snapshotter: untyped, partial_snapshotter: untyped, association_reader: untyped, record_transition: untyped, ?prepared_record_after: untyped) -> void
|
|
8
8
|
|
|
9
9
|
# : (untyped, untyped, RecordSnapshot?, event: ActivityEvent) -> RecordSnapshot?
|
|
10
10
|
def advance_root: (untyped, untyped, RecordSnapshot?, event: ActivityEvent) -> RecordSnapshot?
|
|
@@ -17,12 +17,12 @@ module PaperTrailDiff
|
|
|
17
17
|
|
|
18
18
|
@to: AssociationSnapshot
|
|
19
19
|
|
|
20
|
+
# A transition names the one record that changed between adjacent
|
|
21
|
+
# snapshots. With matching identities it is an update; otherwise the
|
|
22
|
+
# before record left and the after record joined.
|
|
20
23
|
# : (CollectionTransition) -> CollectionAssociationDiff
|
|
21
24
|
def transition_difference: (CollectionTransition) -> CollectionAssociationDiff
|
|
22
25
|
|
|
23
|
-
# : (RecordSnapshot?, RecordSnapshot?) -> RecordChange?
|
|
24
|
-
def compare_transition_records: (RecordSnapshot?, RecordSnapshot?) -> RecordChange?
|
|
25
|
-
|
|
26
26
|
# : () -> Array[RecordChange]?
|
|
27
27
|
def aligned_changes: () -> Array[RecordChange]?
|
|
28
28
|
|
|
@@ -57,6 +57,9 @@ module PaperTrailDiff
|
|
|
57
57
|
# : (identity) -> Array[untyped]
|
|
58
58
|
def sortable_identity: (identity) -> Array[untyped]
|
|
59
59
|
|
|
60
|
+
# Only the order of the group numbers matters, so moving the lowest one
|
|
61
|
+
# down or the highest one up changes nothing; the spec checks the order.
|
|
62
|
+
# mutant:disable
|
|
60
63
|
# : (untyped) -> Array[untyped]
|
|
61
64
|
def sortable_id: (untyped) -> Array[untyped]
|
|
62
65
|
|
|
@@ -6,8 +6,8 @@ module PaperTrailDiff
|
|
|
6
6
|
# : (Array[untyped]) -> void
|
|
7
7
|
def initialize: (Array[untyped]) -> void
|
|
8
8
|
|
|
9
|
-
# : (
|
|
10
|
-
def position: (
|
|
9
|
+
# : (String, untyped) -> Integer?
|
|
10
|
+
def position: (String, untyped) -> Integer?
|
|
11
11
|
|
|
12
12
|
# : (untyped) -> Integer?
|
|
13
13
|
def position_for_id: (untyped) -> Integer?
|
|
@@ -16,7 +16,7 @@ module PaperTrailDiff
|
|
|
16
16
|
|
|
17
17
|
@id_positions: Hash[String, Integer?]
|
|
18
18
|
|
|
19
|
-
@
|
|
19
|
+
@identities: Set[Array[untyped]]
|
|
20
20
|
|
|
21
21
|
@serialized_positions: Hash[Array[String], Integer]
|
|
22
22
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Generated from lib/paper_trail_diff/deleted_analysis_batch.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module PaperTrailDiff
|
|
4
|
+
# Analyzes missing roots together without pretending that they have live rows.
|
|
5
|
+
class DeletedAnalysisBatch
|
|
6
|
+
# : (untyped, identities: Array[Array[String]], time_range: TimeRange?, analyzer: untyped, history_preparer: untyped, ?version_scope: untyped) -> void
|
|
7
|
+
def initialize: (untyped, identities: Array[Array[String]], time_range: TimeRange?, analyzer: untyped, history_preparer: untyped, ?version_scope: untyped) -> void
|
|
8
|
+
|
|
9
|
+
# : () -> Hash[Array[String], Analysis?]
|
|
10
|
+
def call: () -> Hash[Array[String], Analysis?]
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
# : (Hash[Array[String], Analysis]) -> Hash[Array[String], Analysis?]
|
|
15
|
+
def with_unavailable: (Hash[Array[String], Analysis]) -> Hash[Array[String], Analysis?]
|
|
16
|
+
|
|
17
|
+
@analyzer: untyped
|
|
18
|
+
|
|
19
|
+
@history_preparer: untyped
|
|
20
|
+
|
|
21
|
+
@identities: Array[Array[String]]
|
|
22
|
+
|
|
23
|
+
@model: untyped
|
|
24
|
+
|
|
25
|
+
@time_range: TimeRange?
|
|
26
|
+
|
|
27
|
+
@version_scope: untyped
|
|
28
|
+
|
|
29
|
+
# These records supply identity and model metadata only. Every reported
|
|
30
|
+
# value comes from the batched historical plan; no per-root reify or live
|
|
31
|
+
# lookup is needed to get into the comparison engine.
|
|
32
|
+
# : () -> Array[untyped]
|
|
33
|
+
def historical_roots: () -> Array[untyped]
|
|
34
|
+
|
|
35
|
+
# : () -> Array[untyped]
|
|
36
|
+
def destroy_versions: () -> Array[untyped]
|
|
37
|
+
|
|
38
|
+
# : (Array[untyped]) -> Hash[Symbol, untyped]
|
|
39
|
+
def preparation_range: (Array[untyped]) -> Hash[Symbol, untyped]
|
|
40
|
+
|
|
41
|
+
# : (Array[untyped], Hash[Array[String], RootVersionPlan]) -> void
|
|
42
|
+
def prepare: (Array[untyped], Hash[Array[String], RootVersionPlan]) -> void
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/paper_trail_diff/direct_record_state_loader.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module PaperTrailDiff
|
|
4
|
+
# Completes plain recorded state without invoking model initialization or writers.
|
|
5
|
+
# Decline model behavior whose values require an actual ActiveRecord instance.
|
|
6
|
+
class DirectRecordStateLoader
|
|
7
|
+
# : () -> void
|
|
8
|
+
def initialize: () -> void
|
|
9
|
+
|
|
10
|
+
# : (untyped) -> PreparedRecordState?
|
|
11
|
+
def call: (untyped) -> PreparedRecordState?
|
|
12
|
+
|
|
13
|
+
# : (PreparedRecordState) -> PreparedRecordState?
|
|
14
|
+
def complete: (PreparedRecordState) -> PreparedRecordState?
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
@defaults: Hash[untyped, Hash[untyped, untyped]]
|
|
19
|
+
|
|
20
|
+
@loader: PreparedVersionStateLoader
|
|
21
|
+
|
|
22
|
+
@supported: Hash[untyped, bool]
|
|
23
|
+
|
|
24
|
+
# : (untyped) -> bool
|
|
25
|
+
def supported?: (untyped) -> bool
|
|
26
|
+
|
|
27
|
+
# : (untyped) -> bool
|
|
28
|
+
def plain_model?: (untyped) -> bool
|
|
29
|
+
|
|
30
|
+
# : (untyped) -> bool
|
|
31
|
+
def plain_attributes?: (untyped) -> bool
|
|
32
|
+
|
|
33
|
+
# : (untyped) -> bool
|
|
34
|
+
def application_defaults?: (untyped) -> bool
|
|
35
|
+
|
|
36
|
+
# : (untyped) -> bool
|
|
37
|
+
def encrypted?: (untyped) -> bool
|
|
38
|
+
|
|
39
|
+
# : (untyped) -> bool
|
|
40
|
+
def framework_class?: (untyped) -> bool
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -33,6 +33,11 @@ module PaperTrailDiff
|
|
|
33
33
|
# : (untyped) -> untyped
|
|
34
34
|
def self?.model_class: (untyped) -> untyped
|
|
35
35
|
|
|
36
|
+
# The record's own PaperTrail versions, under whatever name the model gave
|
|
37
|
+
# the association.
|
|
38
|
+
# : (untyped) -> untyped
|
|
39
|
+
def self?.versions: (untyped) -> untyped
|
|
40
|
+
|
|
36
41
|
# : (untyped) -> untyped
|
|
37
42
|
def self?.reload_record: (untyped) -> untyped
|
|
38
43
|
|
|
@@ -18,6 +18,8 @@ module PaperTrailDiff
|
|
|
18
18
|
# : (AssociationSnapshot?, AssociationSnapshot?) -> void
|
|
19
19
|
private def self.validate_association_kinds!: (AssociationSnapshot?, AssociationSnapshot?) -> void
|
|
20
20
|
|
|
21
|
+
# Kinds are symbols, so `!=`, `equal?`, and `eql?` all agree here.
|
|
22
|
+
# mutant:disable
|
|
21
23
|
# : (AssociationSnapshot?, AssociationSnapshot?) -> bool
|
|
22
24
|
private def self.kinds_differ?: (AssociationSnapshot?, AssociationSnapshot?) -> bool
|
|
23
25
|
|
|
@@ -36,7 +38,7 @@ module PaperTrailDiff
|
|
|
36
38
|
# : (AssociationSnapshot, AssociationSnapshot) -> CollectionAssociationDiff
|
|
37
39
|
private def self.compare_collection: (AssociationSnapshot, AssociationSnapshot) -> CollectionAssociationDiff
|
|
38
40
|
|
|
39
|
-
# : (RecordSnapshot?, RecordSnapshot?) ->
|
|
40
|
-
private def self.same_identity?: (RecordSnapshot?, RecordSnapshot?) ->
|
|
41
|
+
# : (RecordSnapshot?, RecordSnapshot?) -> boolish
|
|
42
|
+
private def self.same_identity?: (RecordSnapshot?, RecordSnapshot?) -> boolish
|
|
41
43
|
end
|
|
42
44
|
end
|
|
@@ -9,6 +9,10 @@ module PaperTrailDiff
|
|
|
9
9
|
class ConfigurationError < Error
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
# Raised when nested data keys cannot be represented by unique string paths.
|
|
13
|
+
class AmbiguousNestedKeyError < Error
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
# Raised when compare endpoints do not belong to the same PaperTrail item.
|
|
13
17
|
class VersionMismatchError < Error
|
|
14
18
|
end
|
|
@@ -46,6 +50,14 @@ module PaperTrailDiff
|
|
|
46
50
|
class BatchLimitExceededError < Error
|
|
47
51
|
end
|
|
48
52
|
|
|
53
|
+
# Historical candidate loading exceeded its explicitly bounded work budget.
|
|
54
|
+
class FilterLimitExceededError < Error
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# A batch selected a known expensive association without explicitly opting in.
|
|
58
|
+
class UnsupportedBatchPathError < ConfigurationError
|
|
59
|
+
end
|
|
60
|
+
|
|
49
61
|
# Raised when a requested ActiveRecord association does not exist.
|
|
50
62
|
class UnknownAssociationError < Error
|
|
51
63
|
end
|
|
@@ -25,6 +25,14 @@ module PaperTrailDiff
|
|
|
25
25
|
# : (untyped, untyped) -> void
|
|
26
26
|
def reify_has_many: (untyped, untyped) -> void
|
|
27
27
|
|
|
28
|
+
# PT-AT's collection-source helper reifies every has_many on each join
|
|
29
|
+
# record. Walk only the requested source instead, including nested throughs.
|
|
30
|
+
# : (untyped, untyped) -> void
|
|
31
|
+
def reify_through: (untyped, untyped) -> void
|
|
32
|
+
|
|
33
|
+
# : (untyped, untyped, untyped) -> Array[untyped]
|
|
34
|
+
def through_members: (untyped, untyped, untyped) -> Array[untyped]
|
|
35
|
+
|
|
28
36
|
# : (untyped, untyped) -> void
|
|
29
37
|
def reify_habtm: (untyped, untyped) -> void
|
|
30
38
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Generated from lib/paper_trail_diff/historical_filter.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module PaperTrailDiff
|
|
4
|
+
# Selects roots by the values they held at any point in the window, with an
|
|
5
|
+
# explicit ceiling on version loading.
|
|
6
|
+
#
|
|
7
|
+
# A version records the state *before* its own change, so the versions in
|
|
8
|
+
# the window supply the state at its start and after every change but the
|
|
9
|
+
# last. The state after the last change lives in the first version after
|
|
10
|
+
# the window, or in the live row when nothing follows; a destroy leaves none.
|
|
11
|
+
class HistoricalFilter
|
|
12
|
+
DEFAULT_VERSION_LIMIT: ::Integer
|
|
13
|
+
|
|
14
|
+
CANDIDATE_BATCH: ::Integer
|
|
15
|
+
|
|
16
|
+
# : (untyped, predicate: untyped, time_range: TimeRange?, limit: Integer, max_versions: Integer) -> void
|
|
17
|
+
def initialize: (untyped, predicate: untyped, time_range: TimeRange?, limit: Integer, max_versions: Integer) -> void
|
|
18
|
+
|
|
19
|
+
# : (Array[String]) -> Array[String]
|
|
20
|
+
def call: (Array[String]) -> Array[String]
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
@limit: Integer
|
|
25
|
+
|
|
26
|
+
@loaded: Integer
|
|
27
|
+
|
|
28
|
+
@max_versions: Integer
|
|
29
|
+
|
|
30
|
+
@model: untyped
|
|
31
|
+
|
|
32
|
+
@predicate: untyped
|
|
33
|
+
|
|
34
|
+
@state_loader: PreparedVersionStateLoader
|
|
35
|
+
|
|
36
|
+
@time_range: TimeRange?
|
|
37
|
+
|
|
38
|
+
# : (untyped) -> untyped
|
|
39
|
+
def validate_predicate: (untyped) -> untyped
|
|
40
|
+
|
|
41
|
+
# : (untyped) -> Integer
|
|
42
|
+
def validate_budget: (untyped) -> Integer
|
|
43
|
+
|
|
44
|
+
# : (Array[String]) -> Hash[String, Array[untyped]]
|
|
45
|
+
def candidate_versions: (Array[String]) -> Hash[String, Array[untyped]]
|
|
46
|
+
|
|
47
|
+
# : (Array[untyped], untyped) -> boolish
|
|
48
|
+
def held?: (Array[untyped], untyped) -> boolish
|
|
49
|
+
|
|
50
|
+
# What each candidate held after its last change in the window.
|
|
51
|
+
# : (Array[String], Hash[String, Array[untyped]]) -> Hash[String, untyped]
|
|
52
|
+
def closing_states: (Array[String], Hash[String, Array[untyped]]) -> Hash[String, untyped]
|
|
53
|
+
|
|
54
|
+
# : (Array[String]) -> Hash[String, untyped]
|
|
55
|
+
def trailing_versions: (Array[String]) -> Hash[String, untyped]
|
|
56
|
+
|
|
57
|
+
# : (Array[String]) -> Hash[String, untyped]
|
|
58
|
+
def live_records: (Array[String]) -> Hash[String, untyped]
|
|
59
|
+
|
|
60
|
+
# : (untyped) -> boolish
|
|
61
|
+
def record_matches?: (untyped) -> boolish
|
|
62
|
+
|
|
63
|
+
# : (Integer) -> void
|
|
64
|
+
def account_versions!: (Integer) -> void
|
|
65
|
+
|
|
66
|
+
# : (untyped) -> boolish
|
|
67
|
+
def matches?: (untyped) -> boolish
|
|
68
|
+
|
|
69
|
+
# : (untyped) -> bool
|
|
70
|
+
def attributes_match?: (untyped) -> bool
|
|
71
|
+
|
|
72
|
+
# : () -> void
|
|
73
|
+
def reject_root_limit!: () -> void
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -9,8 +9,13 @@ module PaperTrailDiff
|
|
|
9
9
|
# : (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
10
10
|
def prepare: (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
11
11
|
|
|
12
|
-
# : (Array[untyped], Array[untyped]) -> void
|
|
13
|
-
def prepare_batch: (Array[untyped], Array[untyped]) -> void
|
|
12
|
+
# : (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
13
|
+
def prepare_batch: (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
14
|
+
|
|
15
|
+
# Missing roots have no live graph to collect. Reading their associations
|
|
16
|
+
# here would issue a query per root and seed nonexistent rows as live state.
|
|
17
|
+
# : (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
18
|
+
def prepare_deleted_batch: (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
14
19
|
|
|
15
20
|
# : (untyped, untyped) -> RecordSnapshot?
|
|
16
21
|
def call: (untyped, untyped) -> RecordSnapshot?
|
|
@@ -24,9 +29,15 @@ module PaperTrailDiff
|
|
|
24
29
|
# : (untyped, habtm_version: untyped) -> untyped
|
|
25
30
|
def association_reader: (untyped, habtm_version: untyped) -> untyped
|
|
26
31
|
|
|
32
|
+
# : () -> PreparedActivityIndex?
|
|
33
|
+
def activity_index: () -> PreparedActivityIndex?
|
|
34
|
+
|
|
27
35
|
# : (untyped) -> [Hash[untyped, untyped], Hash[untyped, untyped]]?
|
|
28
36
|
def record_transition: (untyped) -> [ Hash[untyped, untyped], Hash[untyped, untyped] ]?
|
|
29
37
|
|
|
38
|
+
# : (untyped, ?direct: bool) -> [bool, untyped]
|
|
39
|
+
def record_after: (untyped, ?direct: bool) -> [ bool, untyped ]
|
|
40
|
+
|
|
30
41
|
private
|
|
31
42
|
|
|
32
43
|
@live_graph_collector: LiveGraphCollector
|
|
@@ -37,6 +48,8 @@ module PaperTrailDiff
|
|
|
37
48
|
|
|
38
49
|
@prepared_history: PreparedHistory?
|
|
39
50
|
|
|
51
|
+
@prepared_snapshotter: PreparedSnapshotBuilder
|
|
52
|
+
|
|
40
53
|
@preparer: untyped
|
|
41
54
|
|
|
42
55
|
@snapshots: Hash[Array[untyped], RecordSnapshot?]
|
|
@@ -51,8 +64,8 @@ module PaperTrailDiff
|
|
|
51
64
|
# : (Array[untyped], Array[untyped]) -> Hash[Symbol, untyped]
|
|
52
65
|
def batch_payload: (Array[untyped], Array[untyped]) -> Hash[Symbol, untyped]
|
|
53
66
|
|
|
54
|
-
# : (Array[untyped], Array[untyped]) -> void
|
|
55
|
-
def register_batch: (Array[untyped], Array[untyped]) -> void
|
|
67
|
+
# : (Array[untyped], Array[untyped], ?live_records: Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
68
|
+
def register_batch: (Array[untyped], Array[untyped], ?live_records: Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
|
|
56
69
|
|
|
57
70
|
# : (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer) -> RecordSnapshot?
|
|
58
71
|
def snapshot_from_version: (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer) -> RecordSnapshot?
|