paper_trail_diff 0.16.0 → 0.17.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 +581 -1
- data/README.md +42 -7
- data/docs/architecture.md +7 -5
- data/docs/performance.md +86 -38
- data/docs/reference.md +309 -92
- data/docs/testing.md +240 -32
- data/lib/paper_trail_diff/activity_belongs_to_event_applier.rb +2 -16
- data/lib/paper_trail_diff/activity_boundary.rb +55 -34
- data/lib/paper_trail_diff/activity_child_candidate_loader.rb +46 -57
- data/lib/paper_trail_diff/activity_collection_event_applier.rb +3 -13
- data/lib/paper_trail_diff/activity_collection_route_updater.rb +1 -1
- data/lib/paper_trail_diff/activity_event.rb +33 -21
- data/lib/paper_trail_diff/activity_event_record_resolver.rb +16 -116
- data/lib/paper_trail_diff/activity_event_route_finder.rb +29 -29
- data/lib/paper_trail_diff/activity_event_snapshot_refresher.rb +2 -7
- data/lib/paper_trail_diff/activity_history.rb +90 -49
- data/lib/paper_trail_diff/activity_range.rb +9 -35
- data/lib/paper_trail_diff/activity_root_snapshot_refresher.rb +74 -40
- data/lib/paper_trail_diff/activity_root_steps.rb +10 -13
- data/lib/paper_trail_diff/activity_scope_filter.rb +77 -0
- data/lib/paper_trail_diff/activity_snapshot_delta.rb +12 -15
- data/lib/paper_trail_diff/activity_snapshot_sequence.rb +37 -15
- data/lib/paper_trail_diff/activity_target_candidate_loader.rb +35 -43
- data/lib/paper_trail_diff/activity_timeline_builder.rb +194 -249
- data/lib/paper_trail_diff/activity_transaction_grouper.rb +3 -1
- data/lib/paper_trail_diff/activity_tree_filter.rb +54 -13
- data/lib/paper_trail_diff/activity_version_collector.rb +72 -138
- data/lib/paper_trail_diff/activity_view.rb +22 -11
- data/lib/paper_trail_diff/analysis.rb +19 -5
- data/lib/paper_trail_diff/analysis_batch.rb +16 -58
- data/lib/paper_trail_diff/approximate_paths.rb +4 -8
- data/lib/paper_trail_diff/association_activity_edge.rb +5 -24
- data/lib/paper_trail_diff/association_activity_selection.rb +10 -18
- data/lib/paper_trail_diff/association_discovery.rb +1 -6
- data/lib/paper_trail_diff/association_key.rb +9 -6
- data/lib/paper_trail_diff/association_traversal.rb +49 -6
- data/lib/paper_trail_diff/batch_boundary_resolver.rb +33 -42
- data/lib/paper_trail_diff/batch_preload.rb +2 -12
- data/lib/paper_trail_diff/batched_root_analyses.rb +72 -0
- data/lib/paper_trail_diff/batched_root_analyzer.rb +16 -14
- data/lib/paper_trail_diff/batched_root_versions.rb +25 -20
- data/lib/paper_trail_diff/branch_snapshot_refresher.rb +27 -31
- data/lib/paper_trail_diff/change_attribution.rb +329 -0
- data/lib/paper_trail_diff/change_row.rb +30 -10
- data/lib/paper_trail_diff/comparison_batch.rb +3 -4
- data/lib/paper_trail_diff/configuration.rb +1 -1
- data/lib/paper_trail_diff/deleted_analysis_batch.rb +22 -37
- data/lib/paper_trail_diff/deleted_root_filter.rb +3 -6
- data/lib/paper_trail_diff/deprecation.rb +4 -43
- data/lib/paper_trail_diff/diagnostics.rb +1 -2
- data/lib/paper_trail_diff/direct_record_state_loader.rb +8 -1
- data/lib/paper_trail_diff/endpoint.rb +78 -44
- data/lib/paper_trail_diff/errors.rb +2 -9
- data/lib/paper_trail_diff/fallback_paths.rb +2 -5
- data/lib/paper_trail_diff/habtm_transaction_owners.rb +5 -3
- data/lib/paper_trail_diff/historical_association_reifier.rb +3 -1
- data/lib/paper_trail_diff/historical_filter.rb +40 -15
- data/lib/paper_trail_diff/historical_snapshot_store.rb +80 -38
- data/lib/paper_trail_diff/instrumentation.rb +0 -8
- data/lib/paper_trail_diff/live_endpoint_batch_loader.rb +11 -7
- data/lib/paper_trail_diff/live_endpoint_provider.rb +7 -23
- data/lib/paper_trail_diff/live_graph_collector.rb +3 -3
- data/lib/paper_trail_diff/nested_comparator.rb +46 -19
- data/lib/paper_trail_diff/net_change.rb +276 -0
- data/lib/paper_trail_diff/own_window.rb +35 -0
- data/lib/paper_trail_diff/paper_trail_adapter.rb +40 -45
- data/lib/paper_trail_diff/prepared_activity_index.rb +197 -45
- data/lib/paper_trail_diff/prepared_child_candidates.rb +58 -0
- data/lib/paper_trail_diff/prepared_edge_loader.rb +43 -107
- data/lib/paper_trail_diff/prepared_history.rb +20 -31
- data/lib/paper_trail_diff/prepared_history_loader.rb +46 -9
- data/lib/paper_trail_diff/prepared_record_index.rb +137 -47
- data/lib/paper_trail_diff/prepared_snapshot_builder.rb +16 -0
- data/lib/paper_trail_diff/prepared_state_association_reader.rb +17 -19
- data/lib/paper_trail_diff/read_snapshot.rb +41 -19
- data/lib/paper_trail_diff/recorded_changes.rb +10 -11
- data/lib/paper_trail_diff/recorded_changes_reader.rb +60 -0
- data/lib/paper_trail_diff/recorded_class.rb +14 -19
- data/lib/paper_trail_diff/recorded_columns.rb +33 -0
- data/lib/paper_trail_diff/root_version_plan.rb +20 -22
- data/lib/paper_trail_diff/root_version_selection.rb +39 -29
- data/lib/paper_trail_diff/scope_condition.rb +7 -17
- data/lib/paper_trail_diff/scope_ranking.rb +16 -22
- data/lib/paper_trail_diff/scoped_analysis.rb +27 -4
- data/lib/paper_trail_diff/scoped_analysis_builder.rb +4 -3
- data/lib/paper_trail_diff/scoped_root_selection.rb +60 -41
- data/lib/paper_trail_diff/snapshot_normalizer.rb +18 -3
- data/lib/paper_trail_diff/stored_json_values.rb +52 -0
- data/lib/paper_trail_diff/stored_time_precision.rb +30 -18
- data/lib/paper_trail_diff/stored_values.rb +20 -0
- data/lib/paper_trail_diff/support.rb +185 -35
- data/lib/paper_trail_diff/time_of_day.rb +39 -0
- data/lib/paper_trail_diff/time_range.rb +37 -20
- data/lib/paper_trail_diff/time_version_range.rb +5 -10
- data/lib/paper_trail_diff/timeline_builder.rb +3 -3
- data/lib/paper_trail_diff/timeline_range.rb +18 -12
- data/lib/paper_trail_diff/timeline_snapshot_provider.rb +1 -1
- data/lib/paper_trail_diff/total_order.rb +55 -0
- data/lib/paper_trail_diff/transaction_cut.rb +192 -91
- data/lib/paper_trail_diff/traversal_preparer.rb +5 -8
- data/lib/paper_trail_diff/value_objects.rb +8 -4
- data/lib/paper_trail_diff/version.rb +1 -1
- data/lib/paper_trail_diff/version_association_candidate_scope.rb +27 -16
- data/lib/paper_trail_diff/version_boundary.rb +37 -21
- data/lib/paper_trail_diff/version_query.rb +25 -25
- data/lib/paper_trail_diff/version_range.rb +12 -16
- data/lib/paper_trail_diff/version_sequence_diagnostics.rb +32 -0
- data/lib/paper_trail_diff/version_table.rb +12 -8
- data/lib/paper_trail_diff.rb +28 -42
- data/sig/generated/paper_trail_diff/activity_belongs_to_event_applier.rbs +0 -8
- data/sig/generated/paper_trail_diff/activity_boundary.rbs +39 -17
- data/sig/generated/paper_trail_diff/activity_child_candidate_loader.rbs +19 -22
- data/sig/generated/paper_trail_diff/activity_collection_event_applier.rbs +0 -5
- data/sig/generated/paper_trail_diff/activity_event.rbs +25 -9
- data/sig/generated/paper_trail_diff/activity_event_record_resolver.rbs +6 -34
- data/sig/generated/paper_trail_diff/activity_event_route_finder.rbs +11 -4
- data/sig/generated/paper_trail_diff/activity_event_snapshot_refresher.rbs +0 -3
- data/sig/generated/paper_trail_diff/activity_history.rbs +54 -19
- data/sig/generated/paper_trail_diff/activity_range.rbs +6 -20
- data/sig/generated/paper_trail_diff/activity_root_snapshot_refresher.rbs +36 -2
- data/sig/generated/paper_trail_diff/activity_root_steps.rbs +6 -6
- data/sig/generated/paper_trail_diff/activity_scope_filter.rbs +51 -0
- data/sig/generated/paper_trail_diff/activity_snapshot_delta.rbs +5 -3
- data/sig/generated/paper_trail_diff/activity_snapshot_sequence.rbs +21 -3
- data/sig/generated/paper_trail_diff/activity_target_candidate_loader.rbs +19 -24
- data/sig/generated/paper_trail_diff/activity_timeline_builder.rbs +121 -127
- data/sig/generated/paper_trail_diff/activity_tree_filter.rbs +41 -8
- data/sig/generated/paper_trail_diff/activity_version_collector.rbs +42 -35
- data/sig/generated/paper_trail_diff/activity_view.rbs +16 -8
- data/sig/generated/paper_trail_diff/analysis.rbs +15 -6
- data/sig/generated/paper_trail_diff/analysis_batch.rbs +6 -24
- data/sig/generated/paper_trail_diff/association_activity_edge.rbs +0 -13
- data/sig/generated/paper_trail_diff/association_activity_selection.rbs +6 -9
- data/sig/generated/paper_trail_diff/association_discovery.rbs +0 -3
- data/sig/generated/paper_trail_diff/association_key.rbs +5 -0
- data/sig/generated/paper_trail_diff/association_traversal.rbs +26 -2
- data/sig/generated/paper_trail_diff/batch_boundary_resolver.rbs +17 -17
- data/sig/generated/paper_trail_diff/batch_preload.rbs +0 -4
- data/sig/generated/paper_trail_diff/batched_root_analyses.rbs +47 -0
- data/sig/generated/paper_trail_diff/batched_root_analyzer.rbs +9 -8
- data/sig/generated/paper_trail_diff/batched_root_versions.rbs +10 -6
- data/sig/generated/paper_trail_diff/branch_snapshot_refresher.rbs +11 -5
- data/sig/generated/paper_trail_diff/change_attribution.rbs +194 -0
- data/sig/generated/paper_trail_diff/change_row.rbs +22 -7
- data/sig/generated/paper_trail_diff/deleted_analysis_batch.rbs +11 -12
- data/sig/generated/paper_trail_diff/deleted_root_filter.rbs +0 -2
- data/sig/generated/paper_trail_diff/deprecation.rbs +4 -24
- data/sig/generated/paper_trail_diff/direct_record_state_loader.rbs +4 -0
- data/sig/generated/paper_trail_diff/endpoint.rbs +40 -16
- data/sig/generated/paper_trail_diff/errors.rbs +2 -11
- data/sig/generated/paper_trail_diff/habtm_transaction_owners.rbs +2 -1
- data/sig/generated/paper_trail_diff/historical_filter.rbs +20 -9
- data/sig/generated/paper_trail_diff/historical_snapshot_store.rbs +40 -10
- data/sig/generated/paper_trail_diff/instrumentation.rbs +0 -3
- data/sig/generated/paper_trail_diff/live_endpoint_batch_loader.rbs +3 -0
- data/sig/generated/paper_trail_diff/live_endpoint_provider.rbs +5 -8
- data/sig/generated/paper_trail_diff/live_graph_collector.rbs +2 -2
- data/sig/generated/paper_trail_diff/nested_comparator.rbs +20 -4
- data/sig/generated/paper_trail_diff/net_change.rbs +168 -0
- data/sig/generated/paper_trail_diff/own_window.rbs +22 -0
- data/sig/generated/paper_trail_diff/paper_trail_adapter.rbs +9 -6
- data/sig/generated/paper_trail_diff/prepared_activity_index.rbs +114 -14
- data/sig/generated/paper_trail_diff/prepared_child_candidates.rbs +39 -0
- data/sig/generated/paper_trail_diff/prepared_edge_loader.rbs +18 -35
- data/sig/generated/paper_trail_diff/prepared_history.rbs +9 -12
- data/sig/generated/paper_trail_diff/prepared_history_loader.rbs +28 -3
- data/sig/generated/paper_trail_diff/prepared_record_index.rbs +68 -14
- data/sig/generated/paper_trail_diff/prepared_snapshot_builder.rbs +12 -0
- data/sig/generated/paper_trail_diff/prepared_state_association_reader.rbs +6 -7
- data/sig/generated/paper_trail_diff/read_snapshot.rbs +27 -8
- data/sig/generated/paper_trail_diff/recorded_changes.rbs +4 -2
- data/sig/generated/paper_trail_diff/recorded_changes_reader.rbs +41 -0
- data/sig/generated/paper_trail_diff/recorded_class.rbs +7 -6
- data/sig/generated/paper_trail_diff/recorded_columns.rbs +21 -0
- data/sig/generated/paper_trail_diff/root_version_plan.rbs +8 -4
- data/sig/generated/paper_trail_diff/root_version_selection.rbs +27 -13
- data/sig/generated/paper_trail_diff/scope_condition.rbs +0 -2
- data/sig/generated/paper_trail_diff/scope_ranking.rbs +10 -10
- data/sig/generated/paper_trail_diff/scoped_analysis.rbs +19 -0
- data/sig/generated/paper_trail_diff/scoped_analysis_builder.rbs +2 -2
- data/sig/generated/paper_trail_diff/scoped_root_selection.rbs +37 -14
- data/sig/generated/paper_trail_diff/snapshot_normalizer.rbs +7 -0
- data/sig/generated/paper_trail_diff/stored_json_values.rbs +35 -0
- data/sig/generated/paper_trail_diff/stored_time_precision.rbs +19 -5
- data/sig/generated/paper_trail_diff/stored_values.rbs +13 -0
- data/sig/generated/paper_trail_diff/support.rbs +120 -23
- data/sig/generated/paper_trail_diff/time_of_day.rbs +21 -0
- data/sig/generated/paper_trail_diff/time_range.rbs +15 -8
- data/sig/generated/paper_trail_diff/time_version_range.rbs +2 -5
- data/sig/generated/paper_trail_diff/timeline_builder.rbs +2 -2
- data/sig/generated/paper_trail_diff/timeline_range.rbs +12 -7
- data/sig/generated/paper_trail_diff/total_order.rbs +32 -0
- data/sig/generated/paper_trail_diff/transaction_cut.rbs +111 -52
- data/sig/generated/paper_trail_diff/traversal_preparer.rbs +2 -2
- data/sig/generated/paper_trail_diff/value_objects.rbs +5 -1
- data/sig/generated/paper_trail_diff/version_association_candidate_scope.rbs +10 -9
- data/sig/generated/paper_trail_diff/version_boundary.rbs +15 -8
- data/sig/generated/paper_trail_diff/version_query.rbs +17 -10
- data/sig/generated/paper_trail_diff/version_range.rbs +6 -9
- data/sig/generated/paper_trail_diff/version_sequence_diagnostics.rbs +13 -0
- data/sig/generated/paper_trail_diff/version_table.rbs +3 -0
- data/sig/generated/paper_trail_diff.rbs +16 -16
- metadata +28 -6
- data/lib/paper_trail_diff/preloaded_endpoint_batch_loader.rb +0 -60
- data/sig/generated/paper_trail_diff/preloaded_endpoint_batch_loader.rbs +0 -32
|
@@ -9,33 +9,33 @@ module PaperTrailDiff
|
|
|
9
9
|
SUPPORTED_ASSOCIATION_MACROS: untyped
|
|
10
10
|
|
|
11
11
|
# Compares net state between explicit PaperTrail-version or current-record endpoints.
|
|
12
|
-
# : (untyped, untyped, ?associations: association_option, ?ignore: ignore_option, ?
|
|
13
|
-
def self.compare: (untyped, untyped, ?associations: association_option, ?ignore: ignore_option, ?
|
|
12
|
+
# : (untyped, untyped, ?associations: association_option, ?ignore: ignore_option, ?allow_approximate: bool) -> Diff
|
|
13
|
+
def self.compare: (untyped, untyped, ?associations: association_option, ?ignore: ignore_option, ?allow_approximate: bool) -> Diff
|
|
14
14
|
|
|
15
15
|
# Compares many independent endpoint pairs while batching current-record loading.
|
|
16
|
-
# : (Array[comparison_input], ?associations: association_option, ?ignore: ignore_option, ?
|
|
17
|
-
def self.compare_many: (Array[comparison_input], ?associations: association_option, ?ignore: ignore_option, ?
|
|
16
|
+
# : (Array[comparison_input], ?associations: association_option, ?ignore: ignore_option, ?allow_approximate: bool) -> comparison_results
|
|
17
|
+
def self.compare_many: (Array[comparison_input], ?associations: association_option, ?ignore: ignore_option, ?allow_approximate: bool) -> comparison_results
|
|
18
18
|
|
|
19
19
|
# Compares every adjacent reconstructed state in an inclusive version range,
|
|
20
20
|
# by default the record's whole history through its current state.
|
|
21
|
-
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?
|
|
22
|
-
def self.timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?
|
|
21
|
+
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?allow_approximate: bool) -> Array[Step]
|
|
22
|
+
def self.timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?allow_approximate: bool) -> Array[Step]
|
|
23
23
|
|
|
24
24
|
# Compares adjacent root and selected-descendant activity boundaries.
|
|
25
|
-
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?
|
|
26
|
-
def self.activity_timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?
|
|
25
|
+
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?recorded_changes: bool, ?allow_approximate: bool) -> Array[ActivityStep]
|
|
26
|
+
def self.activity_timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?recorded_changes: bool, ?allow_approximate: bool) -> Array[ActivityStep]
|
|
27
27
|
|
|
28
28
|
# Builds an endpoint diff and root-checkpoint timeline while normalizing each version once.
|
|
29
|
-
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?
|
|
30
|
-
def self.analyze: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?
|
|
29
|
+
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?recorded_changes: bool, ?allow_approximate: bool) -> Analysis
|
|
30
|
+
def self.analyze: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?recorded_changes: bool, ?allow_approximate: bool) -> Analysis
|
|
31
31
|
|
|
32
32
|
# Analyzes an array of records over one shared range, preparing their
|
|
33
33
|
# selected history once for the batch instead of once per record, and
|
|
34
34
|
# returns a frozen Hash keyed by identity. Roots with nothing to report in
|
|
35
35
|
# the window return an empty `Analysis`. To let a relation choose the
|
|
36
36
|
# records, use `analyze_scope`.
|
|
37
|
-
# : (Array[untyped], ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?
|
|
38
|
-
def self.analyze_many: (Array[untyped], ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?
|
|
37
|
+
# : (Array[untyped], ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?recorded_changes: bool, ?allow_approximate: bool) -> Hash[identity, Analysis]
|
|
38
|
+
def self.analyze_many: (Array[untyped], ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?recorded_changes: bool, ?allow_approximate: bool) -> Hash[identity, Analysis]
|
|
39
39
|
|
|
40
40
|
# Analyzes every root the relation reaches whose history moved inside the
|
|
41
41
|
# window. With `activity: true`, a change to a record on one of the
|
|
@@ -63,15 +63,15 @@ module PaperTrailDiff
|
|
|
63
63
|
# Note also that a relation selects on current state, not on state during
|
|
64
64
|
# the window: `where(status: 'published')` means published *now*, which is a
|
|
65
65
|
# different set from what was published while the window was open.
|
|
66
|
-
# : (untyped, limit: Integer?, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?
|
|
67
|
-
def self.analyze_scope: (untyped, limit: Integer?, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?
|
|
66
|
+
# : (untyped, limit: Integer?, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?historical_filter: untyped, ?max_filter_versions: Integer, ?include_deleted: bool, ?recorded_changes: bool, ?allow_approximate: bool) -> ScopedAnalysis
|
|
67
|
+
def self.analyze_scope: (untyped, limit: Integer?, ?within: untyped, ?associations: association_option, ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?historical_filter: untyped, ?max_filter_versions: Integer, ?include_deleted: bool, ?recorded_changes: bool, ?allow_approximate: bool) -> ScopedAnalysis
|
|
68
68
|
|
|
69
69
|
# Recent root and selected-child activity through the current saved state,
|
|
70
70
|
# for every root that changed or whose requested associations did.
|
|
71
71
|
# Historical windows remain explicit on analyze_scope; this entry point is
|
|
72
72
|
# deliberately named for a report through now rather than an as-of query.
|
|
73
|
-
# : (untyped, since: untyped, limit: Integer, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?include_deleted: bool, ?historical_filter: untyped, ?max_filter_versions: Integer, ?
|
|
74
|
-
def self.report: (untyped, since: untyped, limit: Integer, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?include_deleted: bool, ?historical_filter: untyped, ?max_filter_versions: Integer, ?
|
|
73
|
+
# : (untyped, since: untyped, limit: Integer, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?include_deleted: bool, ?historical_filter: untyped, ?max_filter_versions: Integer, ?recorded_changes: bool, ?allow_approximate: bool) -> ScopedAnalysis
|
|
74
|
+
def self.report: (untyped, since: untyped, limit: Integer, ?associations: association_option, ?ignore: ignore_option, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?include_deleted: bool, ?historical_filter: untyped, ?max_filter_versions: Integer, ?recorded_changes: bool, ?allow_approximate: bool) -> ScopedAnalysis
|
|
75
75
|
|
|
76
76
|
# Warns about deprecated options; see Deprecation.
|
|
77
77
|
# : () -> untyped
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paper_trail_diff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.17.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Williams
|
|
@@ -84,6 +84,7 @@ files:
|
|
|
84
84
|
- lib/paper_trail_diff/activity_relationship.rb
|
|
85
85
|
- lib/paper_trail_diff/activity_root_snapshot_refresher.rb
|
|
86
86
|
- lib/paper_trail_diff/activity_root_steps.rb
|
|
87
|
+
- lib/paper_trail_diff/activity_scope_filter.rb
|
|
87
88
|
- lib/paper_trail_diff/activity_snapshot_delta.rb
|
|
88
89
|
- lib/paper_trail_diff/activity_snapshot_sequence.rb
|
|
89
90
|
- lib/paper_trail_diff/activity_target_candidate_loader.rb
|
|
@@ -103,9 +104,11 @@ files:
|
|
|
103
104
|
- lib/paper_trail_diff/association_traversal.rb
|
|
104
105
|
- lib/paper_trail_diff/batch_boundary_resolver.rb
|
|
105
106
|
- lib/paper_trail_diff/batch_preload.rb
|
|
107
|
+
- lib/paper_trail_diff/batched_root_analyses.rb
|
|
106
108
|
- lib/paper_trail_diff/batched_root_analyzer.rb
|
|
107
109
|
- lib/paper_trail_diff/batched_root_versions.rb
|
|
108
110
|
- lib/paper_trail_diff/branch_snapshot_refresher.rb
|
|
111
|
+
- lib/paper_trail_diff/change_attribution.rb
|
|
109
112
|
- lib/paper_trail_diff/change_row.rb
|
|
110
113
|
- lib/paper_trail_diff/collection_comparator.rb
|
|
111
114
|
- lib/paper_trail_diff/collection_identity_index.rb
|
|
@@ -131,10 +134,12 @@ files:
|
|
|
131
134
|
- lib/paper_trail_diff/live_endpoint_provider.rb
|
|
132
135
|
- lib/paper_trail_diff/live_graph_collector.rb
|
|
133
136
|
- lib/paper_trail_diff/nested_comparator.rb
|
|
137
|
+
- lib/paper_trail_diff/net_change.rb
|
|
138
|
+
- lib/paper_trail_diff/own_window.rb
|
|
134
139
|
- lib/paper_trail_diff/paper_trail_adapter.rb
|
|
135
|
-
- lib/paper_trail_diff/preloaded_endpoint_batch_loader.rb
|
|
136
140
|
- lib/paper_trail_diff/prepared_activity_index.rb
|
|
137
141
|
- lib/paper_trail_diff/prepared_association_reifier.rb
|
|
142
|
+
- lib/paper_trail_diff/prepared_child_candidates.rb
|
|
138
143
|
- lib/paper_trail_diff/prepared_edge_loader.rb
|
|
139
144
|
- lib/paper_trail_diff/prepared_history.rb
|
|
140
145
|
- lib/paper_trail_diff/prepared_history_loader.rb
|
|
@@ -143,7 +148,9 @@ files:
|
|
|
143
148
|
- lib/paper_trail_diff/prepared_state_association_reader.rb
|
|
144
149
|
- lib/paper_trail_diff/read_snapshot.rb
|
|
145
150
|
- lib/paper_trail_diff/recorded_changes.rb
|
|
151
|
+
- lib/paper_trail_diff/recorded_changes_reader.rb
|
|
146
152
|
- lib/paper_trail_diff/recorded_class.rb
|
|
153
|
+
- lib/paper_trail_diff/recorded_columns.rb
|
|
147
154
|
- lib/paper_trail_diff/root_version_plan.rb
|
|
148
155
|
- lib/paper_trail_diff/root_version_selection.rb
|
|
149
156
|
- lib/paper_trail_diff/scope_condition.rb
|
|
@@ -155,13 +162,17 @@ files:
|
|
|
155
162
|
- lib/paper_trail_diff/snapshot_normalizer.rb
|
|
156
163
|
- lib/paper_trail_diff/snapshot_traversal.rb
|
|
157
164
|
- lib/paper_trail_diff/step.rb
|
|
165
|
+
- lib/paper_trail_diff/stored_json_values.rb
|
|
158
166
|
- lib/paper_trail_diff/stored_time_precision.rb
|
|
167
|
+
- lib/paper_trail_diff/stored_values.rb
|
|
159
168
|
- lib/paper_trail_diff/support.rb
|
|
169
|
+
- lib/paper_trail_diff/time_of_day.rb
|
|
160
170
|
- lib/paper_trail_diff/time_range.rb
|
|
161
171
|
- lib/paper_trail_diff/time_version_range.rb
|
|
162
172
|
- lib/paper_trail_diff/timeline_builder.rb
|
|
163
173
|
- lib/paper_trail_diff/timeline_range.rb
|
|
164
174
|
- lib/paper_trail_diff/timeline_snapshot_provider.rb
|
|
175
|
+
- lib/paper_trail_diff/total_order.rb
|
|
165
176
|
- lib/paper_trail_diff/transaction_cut.rb
|
|
166
177
|
- lib/paper_trail_diff/traversal.rb
|
|
167
178
|
- lib/paper_trail_diff/traversal_emitter.rb
|
|
@@ -194,6 +205,7 @@ files:
|
|
|
194
205
|
- sig/generated/paper_trail_diff/activity_relationship.rbs
|
|
195
206
|
- sig/generated/paper_trail_diff/activity_root_snapshot_refresher.rbs
|
|
196
207
|
- sig/generated/paper_trail_diff/activity_root_steps.rbs
|
|
208
|
+
- sig/generated/paper_trail_diff/activity_scope_filter.rbs
|
|
197
209
|
- sig/generated/paper_trail_diff/activity_snapshot_delta.rbs
|
|
198
210
|
- sig/generated/paper_trail_diff/activity_snapshot_sequence.rbs
|
|
199
211
|
- sig/generated/paper_trail_diff/activity_target_candidate_loader.rbs
|
|
@@ -213,9 +225,11 @@ files:
|
|
|
213
225
|
- sig/generated/paper_trail_diff/association_traversal.rbs
|
|
214
226
|
- sig/generated/paper_trail_diff/batch_boundary_resolver.rbs
|
|
215
227
|
- sig/generated/paper_trail_diff/batch_preload.rbs
|
|
228
|
+
- sig/generated/paper_trail_diff/batched_root_analyses.rbs
|
|
216
229
|
- sig/generated/paper_trail_diff/batched_root_analyzer.rbs
|
|
217
230
|
- sig/generated/paper_trail_diff/batched_root_versions.rbs
|
|
218
231
|
- sig/generated/paper_trail_diff/branch_snapshot_refresher.rbs
|
|
232
|
+
- sig/generated/paper_trail_diff/change_attribution.rbs
|
|
219
233
|
- sig/generated/paper_trail_diff/change_row.rbs
|
|
220
234
|
- sig/generated/paper_trail_diff/collection_comparator.rbs
|
|
221
235
|
- sig/generated/paper_trail_diff/collection_identity_index.rbs
|
|
@@ -241,10 +255,12 @@ files:
|
|
|
241
255
|
- sig/generated/paper_trail_diff/live_endpoint_provider.rbs
|
|
242
256
|
- sig/generated/paper_trail_diff/live_graph_collector.rbs
|
|
243
257
|
- sig/generated/paper_trail_diff/nested_comparator.rbs
|
|
258
|
+
- sig/generated/paper_trail_diff/net_change.rbs
|
|
259
|
+
- sig/generated/paper_trail_diff/own_window.rbs
|
|
244
260
|
- sig/generated/paper_trail_diff/paper_trail_adapter.rbs
|
|
245
|
-
- sig/generated/paper_trail_diff/preloaded_endpoint_batch_loader.rbs
|
|
246
261
|
- sig/generated/paper_trail_diff/prepared_activity_index.rbs
|
|
247
262
|
- sig/generated/paper_trail_diff/prepared_association_reifier.rbs
|
|
263
|
+
- sig/generated/paper_trail_diff/prepared_child_candidates.rbs
|
|
248
264
|
- sig/generated/paper_trail_diff/prepared_edge_loader.rbs
|
|
249
265
|
- sig/generated/paper_trail_diff/prepared_history.rbs
|
|
250
266
|
- sig/generated/paper_trail_diff/prepared_history_loader.rbs
|
|
@@ -253,7 +269,9 @@ files:
|
|
|
253
269
|
- sig/generated/paper_trail_diff/prepared_state_association_reader.rbs
|
|
254
270
|
- sig/generated/paper_trail_diff/read_snapshot.rbs
|
|
255
271
|
- sig/generated/paper_trail_diff/recorded_changes.rbs
|
|
272
|
+
- sig/generated/paper_trail_diff/recorded_changes_reader.rbs
|
|
256
273
|
- sig/generated/paper_trail_diff/recorded_class.rbs
|
|
274
|
+
- sig/generated/paper_trail_diff/recorded_columns.rbs
|
|
257
275
|
- sig/generated/paper_trail_diff/root_version_plan.rbs
|
|
258
276
|
- sig/generated/paper_trail_diff/root_version_selection.rbs
|
|
259
277
|
- sig/generated/paper_trail_diff/scope_condition.rbs
|
|
@@ -265,13 +283,17 @@ files:
|
|
|
265
283
|
- sig/generated/paper_trail_diff/snapshot_normalizer.rbs
|
|
266
284
|
- sig/generated/paper_trail_diff/snapshot_traversal.rbs
|
|
267
285
|
- sig/generated/paper_trail_diff/step.rbs
|
|
286
|
+
- sig/generated/paper_trail_diff/stored_json_values.rbs
|
|
268
287
|
- sig/generated/paper_trail_diff/stored_time_precision.rbs
|
|
288
|
+
- sig/generated/paper_trail_diff/stored_values.rbs
|
|
269
289
|
- sig/generated/paper_trail_diff/support.rbs
|
|
290
|
+
- sig/generated/paper_trail_diff/time_of_day.rbs
|
|
270
291
|
- sig/generated/paper_trail_diff/time_range.rbs
|
|
271
292
|
- sig/generated/paper_trail_diff/time_version_range.rbs
|
|
272
293
|
- sig/generated/paper_trail_diff/timeline_builder.rbs
|
|
273
294
|
- sig/generated/paper_trail_diff/timeline_range.rbs
|
|
274
295
|
- sig/generated/paper_trail_diff/timeline_snapshot_provider.rbs
|
|
296
|
+
- sig/generated/paper_trail_diff/total_order.rbs
|
|
275
297
|
- sig/generated/paper_trail_diff/transaction_cut.rbs
|
|
276
298
|
- sig/generated/paper_trail_diff/traversal.rbs
|
|
277
299
|
- sig/generated/paper_trail_diff/traversal_emitter.rbs
|
|
@@ -292,11 +314,11 @@ licenses:
|
|
|
292
314
|
metadata:
|
|
293
315
|
allowed_push_host: https://rubygems.org
|
|
294
316
|
bug_tracker_uri: https://github.com/aheathwilliams/paper_trail_diff/issues
|
|
295
|
-
changelog_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.
|
|
296
|
-
documentation_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.
|
|
317
|
+
changelog_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.17.1/CHANGELOG.md
|
|
318
|
+
documentation_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.17.1/README.md
|
|
297
319
|
homepage_uri: https://github.com/aheathwilliams/paper_trail_diff
|
|
298
320
|
rubygems_mfa_required: 'true'
|
|
299
|
-
source_code_uri: https://github.com/aheathwilliams/paper_trail_diff/tree/v0.
|
|
321
|
+
source_code_uri: https://github.com/aheathwilliams/paper_trail_diff/tree/v0.17.1
|
|
300
322
|
rdoc_options: []
|
|
301
323
|
require_paths:
|
|
302
324
|
- lib
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# rbs_inline: enabled
|
|
3
|
-
|
|
4
|
-
module PaperTrailDiff
|
|
5
|
-
# Validates and reuses caller-owned live records, reading again only the
|
|
6
|
-
# associations a preload of many records cannot have loaded correctly.
|
|
7
|
-
class PreloadedEndpointBatchLoader
|
|
8
|
-
#: (tree: AssociationTree, traversal: AssociationTraversal) -> void
|
|
9
|
-
def initialize(tree:, traversal:)
|
|
10
|
-
@tree = tree
|
|
11
|
-
@traversal = traversal
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
#: (Array[untyped]) -> Hash[identity, untyped]
|
|
15
|
-
def call(records)
|
|
16
|
-
records.each { |record| validate_record(record, @tree, path: '') }
|
|
17
|
-
records.to_h { |record| [Endpoint.identity(record), record] }
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
# @rbs @tree: AssociationTree
|
|
23
|
-
# @rbs @traversal: AssociationTraversal
|
|
24
|
-
|
|
25
|
-
#: (untyped, AssociationTree, path: String) -> void
|
|
26
|
-
def validate_record(record, tree, path:)
|
|
27
|
-
@traversal.reflections_for(record.class, tree, path: path).each do |reflection|
|
|
28
|
-
validate_association(record, tree, path, reflection)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
#: (untyped, AssociationTree, String, untyped) -> void
|
|
33
|
-
def validate_association(record, tree, path, reflection)
|
|
34
|
-
association_path = Support.association_path(path, reflection.name)
|
|
35
|
-
association = record.association(reflection.name)
|
|
36
|
-
unless association.loaded?
|
|
37
|
-
message = "current endpoint association is not preloaded: #{association_path}"
|
|
38
|
-
raise UnloadedAssociationError, message
|
|
39
|
-
end
|
|
40
|
-
read_alone(association) unless BatchPreload.safe?(reflection)
|
|
41
|
-
|
|
42
|
-
subtree = tree.child(reflection.name)
|
|
43
|
-
return unless subtree
|
|
44
|
-
|
|
45
|
-
Array(association.target).compact.each do |child|
|
|
46
|
-
validate_record(child, subtree, path: association_path)
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Preloading many records applies a limit or offset to all of them
|
|
51
|
-
# together, so what a caller preloaded cannot be trusted: one record keeps
|
|
52
|
-
# another's share, or none. Such an association is read again for each
|
|
53
|
-
# record, as reloading reads it.
|
|
54
|
-
#: (untyped) -> void
|
|
55
|
-
def read_alone(association)
|
|
56
|
-
association.reset
|
|
57
|
-
association.load_target
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Generated from lib/paper_trail_diff/preloaded_endpoint_batch_loader.rb with RBS::Inline
|
|
2
|
-
|
|
3
|
-
module PaperTrailDiff
|
|
4
|
-
# Validates and reuses caller-owned live records, reading again only the
|
|
5
|
-
# associations a preload of many records cannot have loaded correctly.
|
|
6
|
-
class PreloadedEndpointBatchLoader
|
|
7
|
-
# : (tree: AssociationTree, traversal: AssociationTraversal) -> void
|
|
8
|
-
def initialize: (tree: AssociationTree, traversal: AssociationTraversal) -> void
|
|
9
|
-
|
|
10
|
-
# : (Array[untyped]) -> Hash[identity, untyped]
|
|
11
|
-
def call: (Array[untyped]) -> Hash[identity, untyped]
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
@traversal: AssociationTraversal
|
|
16
|
-
|
|
17
|
-
@tree: AssociationTree
|
|
18
|
-
|
|
19
|
-
# : (untyped, AssociationTree, path: String) -> void
|
|
20
|
-
def validate_record: (untyped, AssociationTree, path: String) -> void
|
|
21
|
-
|
|
22
|
-
# : (untyped, AssociationTree, String, untyped) -> void
|
|
23
|
-
def validate_association: (untyped, AssociationTree, String, untyped) -> void
|
|
24
|
-
|
|
25
|
-
# Preloading many records applies a limit or offset to all of them
|
|
26
|
-
# together, so what a caller preloaded cannot be trusted: one record keeps
|
|
27
|
-
# another's share, or none. Such an association is read again for each
|
|
28
|
-
# record, as reloading reads it.
|
|
29
|
-
# : (untyped) -> void
|
|
30
|
-
def read_alone: (untyped) -> void
|
|
31
|
-
end
|
|
32
|
-
end
|