This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Before state | |
run_me = false | |
(Provider.find_by(code: "EEU")) if run_me | |
#<Provider:0x00007fe5328a0768 id: 2619, name: "University of Ellucian", code: "EEU", created_at: Wed, 24 Feb 2021 12:23:48.431310000 GMT +00:00, updated_at: Mon, 20 Feb 2023 05:50:44.486124000 GMT +00:00, region_code: nil, postcode: "", provider_type: "university", latitude: nil, longitude: nil, vendor_id: nil> | |
# Supect rogue cache | |
# https://github.com/DFE-Digital/apply-for-teacher-training/blob/main/app/controllers/candidate_interface/course_choices/provider_selection_controller.rb#L8 | |
# https://github.com/DFE-Digital/apply-for-teacher-training/blob/main/app/forms/candidate_interface/continuous_applications/provider_selection_step.rb#L12 | |
(@provider_cache_key ||= "provider-list-#{Provider.maximum(:updated_at)}") if run_me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
courses = RecruitmentCycle.current.providers.find_by(provider_code: "1KN").courses.where(course_code: ["3857", "H430", "3853", "384T", "384G", "38KK",]) | |
courses.update!(can_sponsor_student_visa: false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://qa.publish-teacher-training-courses.service.gov.uk/publish/organisations/G70/2024/courses | |
courses = RecruitmentCycle.current.providers.find_by(provider_code: "G70").courses.where(course_code: ["D514", "A102"]) | |
courses.update!(accredited_provider_code: nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
course = RecruitmentCycle.current.providers.find_by(provider_code: "L75").courses.find_by(course_code: "C577") | |
course.start_date = DateTime.parse("April 2024") | |
course.save! | |
# https://qa.find-postgraduate-teacher-training.service.gov.uk/course/L75/C577 | |
# https://qa.publish-teacher-training-courses.service.gov.uk/publish/organisations/L75/2024/courses/C577/details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider = RecruitmentCycle.current.providers.find_by(provider_code: "3D3") | |
provider.provider_name.strip! | |
provider.save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copies the courses for theses providers | |
providers_to_copy_to = RecruitmentCycle.current.providers.where(provider_code: [ | |
"3FP" | |
]) | |
provider_to_copy_from = RecruitmentCycle.current.providers.find_by(provider_code: "1FP") | |
courses = provider_to_copy_from.courses.where(accredited_provider_code: "C58") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copies the courses for theses providers | |
providers_to_copy_to = RecruitmentCycle.current.providers.where(provider_code: [ | |
"3F4" | |
]) | |
provider_to_copy_from = RecruitmentCycle.current.providers.find_by(provider_code: "3F2") | |
courses = provider_to_copy_from.courses.where.not(accredited_provider_code: "C58") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider = RecruitmentCycle.current.providers.find_by(provider_code: "2R2") | |
provider.discard! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider_codes = ["5V5"] | |
providers = RecruitmentCycle.current.providers.where(provider_code: provider_codes) | |
providers.update!(can_sponsor_skilled_worker_visa: false, can_sponsor_student_visa: false) | |
# # There is a validation issue with UKPRN | |
# provider = RecruitmentCycle.current.next.providers.where(provider_code: "1TW") | |
# provider.save!(can_sponsor_skilled_worker_visa: false, can_sponsor_student_visa:false, validate: false) |