diff --git a/lib/tasks/tmp_zendesk_5819067.rake b/lib/tasks/tmp_zendesk_5819067.rake new file mode 100644 index 000000000..b0b8c05f7 --- /dev/null +++ b/lib/tasks/tmp_zendesk_5819067.rake @@ -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.class == 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.class == 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