Skip to content

Instantly share code, notes, and snippets.

@defong
Last active October 10, 2023 15:04
Show Gist options
  • Save defong/75341eb18bbe333415a614e630bda1ee to your computer and use it in GitHub Desktop.
Save defong/75341eb18bbe333415a614e630bda1ee to your computer and use it in GitHub Desktop.
[DfE] 2255-urgent-courses-on-publish.rb
# https://www.publish-teacher-training-courses.service.gov.uk/publish/organisations/2A6/2024/courses/W611
# https://www.publish-teacher-training-courses.service.gov.uk/publish/organisations/2A6/2024/courses/K018
course = RecruitmentCycle.current.next.providers.find_by(provider_code: "2A6").courses.find_by(course_code: "W611")
course.enrichments.max_by(&:created_at).update(status: "draft", last_published_timestamp_utc: nil)
course.site_statuses.each do |site_status|
site_status.update(vac_status: :full_time_vacancies, status: :new_status, publish: :unpublished)
end
course = RecruitmentCycle.current.next.providers.find_by(provider_code: "2A6").courses.find_by(course_code: "K018")
course.enrichments.max_by(&:created_at).update(status: "draft", last_published_timestamp_utc: nil)
course.site_statuses.each do |site_status|
site_status.update(vac_status: :full_time_vacancies, status: :new_status, publish: :unpublished)
end
course = RecruitmentCycle.current.providers.find_by(provider_code: "138459").courses.find_by(course_code: "3C2F")
course.enrichments.max_by(&:created_at).update(status: "published", last_published_timestamp_utc: Time.now.utc)
course.site_statuses.each do |site_status|
site_status.update(vac_status: :no_vacancies, status: :running)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment