Skip to content

Instantly share code, notes, and snippets.

@defong
Created September 29, 2023 14:28
Show Gist options
  • Save defong/3b15a9072df5ecdcff71fb140818c168 to your computer and use it in GitHub Desktop.
Save defong/3b15a9072df5ecdcff71fb140818c168 to your computer and use it in GitHub Desktop.
[DfE] 2243-publish-teacher-training-courses-support
provider = RecruitmentCycle.current.providers.find_by(provider_code: "27O")
courses = provider.courses.where(course_code: ["2RFG", "F392", "T695"])
courses.each do |course|
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
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment