Closed benwbrum closed 2 weeks ago
Remediation algorithm:
pages_to_remediate = Page.where(status: 'incomplete').select{|page| page.page_versions.second&.status == 'review'}
pages_to_remediate.each do |page|
if page.page_article_links.present?
page.update_columns(status: Page::STATUS_INDEXED)
else
page.update_columns(status: Page::STATUS_TRANSCRIBED)
end
end
Currently, for projects marked as Review Optional, a page in the
review
state (i.e. the page Needs Review) is marked as Incomplete whenever a user approves the page by unchecking the "Mark as needing review" box and hitting Save.We need to fix this behavior and remediate the data.
To remediate the data, we need a migration script that finds all pages in status Incomplete that have a previous page version in Needs Review state, and update the page status to Transcribed or (if the page has article links) Indexed.