Created
July 31, 2019 11:46
-
-
Save timabell/42da425858ebfc5086960291fcdb04d8 to your computer and use it in GitHub Desktop.
This file contains 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
old_provider = Provider.find_by(provider_code: '1QQ') | |
new_provider = Provider.find_by(provider_code: '28Y') | |
old_provider.sites.each { |site| site.provider = new_provider; site.save } | |
old_provider.courses.each { |course| course.provider = new_provider; course.save } | |
old_provider.organisations = [] | |
old_provider.enrichments.each { |enrichment| enrichment.destroy } | |
old_provider.destroy | |
new_provider.provider_name = 'Yeovil Area Teacher Training Alliance' | |
new_provider.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment