Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temp rake task to fix data integrity issues #2156

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/tasks/tmp_zendesk_5819067.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace :tmp_zendesk_5819067 do
desc "Fix a couple of artefacts which have the wrong 'kind'"
task fix_artefact_kinds: :environment do
eco = Artefact.find_by(slug: "energy-company-obligation")
if eco.latest_edition.instance_of?(AnswerEdition) && eco.kind != "answer"
eco.kind = "answer"
eco.save!
else
puts "Skipping energy-company-obligation - had kind #{eco.kind} and latest edition class #{eco.latest_edition.class}"
end

mytc = Artefact.find_by(slug: "manage-your-tax-credits")
if mytc.latest_edition.instance_of?(TransactionEdition) && mytc.kind != "transaction"
mytc.kind = "transaction"
mytc.save!
else
puts "Skipping manage-your-tax-credits - had kind #{mytc.kind} and latest edition class #{mytc.latest_edition.class}"
end
end
end
Loading