Skip to content

Commit 09fdc0f

Browse files
committed
Update comments
1 parent 22191a0 commit 09fdc0f

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

spec/chrono_model/time_machine/transaction_timestamp_spec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@
6868
end
6969

7070
describe 'records updated in the same transaction' do
71-
# This test reproduces the issue where clock_timestamp() in UPDATE triggers
72-
# causes records updated within the same transaction to have different timestamps,
73-
# making them invisible in as_of() queries.
71+
# This test covers the case where an UPDATE trigger uses a non-transaction-stable
72+
# timestamp (e.g., clock_timestamp()), which can cause records updated within the
73+
# same transaction to end up with different validity start times and become
74+
# invisible in as_of() queries.
7475
#
7576
# Scenario:
7677
# 1. Create an "overlap_bro" record
@@ -90,9 +91,9 @@
9091

9192
bro_created_at = bro.history.last.validity.begin
9293

93-
# Query all overlappers as of the bro's creation time
94-
# With clock_timestamp() in UPDATE trigger, updated overlappers would have
95-
# a later timestamp and would NOT be visible here
94+
# Query all overlappers as of the bro's creation time.
95+
# If UPDATE triggers used a non-transaction-stable timestamp, updated overlappers would
96+
# have a later validity start and would NOT be visible here.
9697
overlappers_at_bro_time = Overlapper.as_of(bro_created_at).where(overlap_bro_id: bro.id)
9798

9899
expect(overlappers_at_bro_time.count).to eq(3),

0 commit comments

Comments
 (0)