Skip to content

Commit 2025103

Browse files
committed
Deterministic order
1 parent af9c678 commit 2025103

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/events/snapshot_event.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ class SnapshotEvent < Event
44
# @param record [#organization_id, #created_at]
55
# @return [SnapshotEvent, nil] the intervening snapshot event or null if there aren't any
66
def self.intervening(record)
7-
where(organization_id: record.organization_id, event_time: record.created_at..).first
7+
where(organization_id: record.organization_id, event_time: record.created_at..).
8+
order('created_at desc').
9+
first
810
end
911

1012
# @param organization [Organization]

0 commit comments

Comments
 (0)