Skip to content

Commit e35604f

Browse files
author
Dominique Quatravaux
committed
[datacleanup] Current version ought to be the last one
1 parent f91280c commit e35604f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

confluence.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,17 @@ page_versions <- {
165165
summarize(n = n(), n_distinct = n_distinct(version)) %>%
166166
filter(n != n_distinct) %>%
167167
nrow == 0)
168-
page_versions
168+
## Current version ought to be the last version:
169+
stopifnot(page_versions %>%
170+
group_by(originalVersion) %>%
171+
summarize(last = max(version),
172+
original = tibble(version, is.original) %>%
173+
filter(is.original) %>%
174+
pull(version)) %>%
175+
filter(last != original) %>%
176+
nrow == 0)
177+
page_versions %>% rename(is.latest = is.original,
178+
latest.version = originalVersion)
169179
}
170180

171181
bodies <- {

0 commit comments

Comments
 (0)