generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2311 from UKGovernmentBEIS/3005-new-dsit-org-id
(3005) Change DSIT organisations' IATI references and names
- Loading branch information
Showing
10 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
class ChangeBeisToDsit < ActiveRecord::Migration[6.1] | ||
def up | ||
service_owner = Organisation.where(iati_reference: "GB-GOV-13").first | ||
if service_owner | ||
service_owner.iati_reference = "GB-GOV-26" | ||
service_owner.name = "DEPARTMENT FOR SCIENCE, INNOVATION AND TECHNOLOGY" | ||
service_owner.beis_organisation_reference = "DSIT" | ||
|
||
unless service_owner.save | ||
Rails.logger.error("Failed to save the changes to #{service_owner.name}: #{service_owner.errors.messages.inspect}") | ||
end | ||
end | ||
|
||
finance = Organisation.where(iati_reference: "GB-GOV-13-OPERATIONS").first | ||
if finance | ||
finance.iati_reference = "GB-GOV-26-OPERATIONS" | ||
finance.name = "DSIT FINANCE" | ||
finance.beis_organisation_reference = "DF" | ||
|
||
unless finance.save | ||
Rails.logger.error("Failed to save the changes to #{finance.name}: #{finance.errors.messages.inspect}") | ||
end | ||
end | ||
end | ||
|
||
def down | ||
service_owner = Organisation.where(iati_reference: "GB-GOV-26").first | ||
if service_owner | ||
service_owner.iati_reference = "GB-GOV-13" | ||
service_owner.name = "DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY" | ||
service_owner.beis_organisation_reference = "BEIS" | ||
|
||
unless service_owner.save | ||
Rails.logger.error("Failed to save the changes to #{service_owner.name}: #{service_owner.errors.messages.inspect}") | ||
end | ||
end | ||
|
||
finance = Organisation.where(iati_reference: "GB-GOV-26-OPERATIONS").first | ||
if finance | ||
finance.iati_reference = "GB-GOV-13-OPERATIONS" | ||
finance.name = "BEIS FINANCE" | ||
finance.beis_organisation_reference = "BF" | ||
|
||
unless finance.save | ||
Rails.logger.error("Failed to save the changes to #{finance.name}: #{finance.errors.messages.inspect}") | ||
end | ||
end | ||
end | ||
end |
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
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
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
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
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