Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save defong/e1466c46dee12d7ee01f98161459ba1b to your computer and use it in GitHub Desktop.

Select an option

Save defong/e1466c46dee12d7ee01f98161459ba1b to your computer and use it in GitHub Desktop.
[DfE] 2265-move-all-courses-application-open-date-in-sandbox-to-3-october-2023-for-providers-with-codes-2a2-and-eeu.rb
if Rails.env.sandbox_aks? do
current_recruitment_cycle = RecruitmentCycle.current
applications_open_date = DateTime.parse("03 Oct 2023").beginning_of_day
current_recruitment_cycle.update!(application_start_date: applications_open_date)
provider_code = ["2A2", "EEU"]
providers = current_recruitment_cycle.reload.providers.where(provider_code:)
courses = providers.flat_map(&:courses)
courses.each do |course|
course.update!(applications_open_from: applications_open_date)
end
end
# ["Chemistry with biology (SEND) (2A2/G065) [2024/25]",
# "Art and design (2A2/E845) [2024/25]",
# "Art and design (2A2/N387) [2024/25]",
# "Biology with chemistry (SEND) (2A2/N412) [2024/25]",
# "Mathematics (2A2/X223) [2024/25]",
# "Primary (2A2/Y068) [2024/25]",
# "Primary with mathematics (EEU/U906) [2024/25]",
# "Primary with science (EEU/X581) [2024/25]"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment