Remove obsolete rake tasks

These tasks dealt with data migrations or stats generations which were
done only once, so we don't need them anymore.

New CONSUL installations don't need these tasks, and existing CONSUL
installations will execute them when upgrading one release at a time.
This commit is contained in:
Javi Martín
2019-03-21 14:10:00 +01:00
parent 7d472b747e
commit 9d6bd7e788
17 changed files with 0 additions and 786 deletions

View File

@@ -13,22 +13,4 @@ namespace :budgets do
end
namespace :phases do
desc "Generates Phases for existing Budgets without them & migrates description_* attributes"
task generate_missing: :environment do
Budget.where.not(id: Budget::Phase.all.pluck(:budget_id).uniq.compact).each do |budget|
Budget::Phase::PHASE_KINDS.each do |phase|
Budget::Phase.create(
budget: budget,
kind: phase,
description: budget.send("description_#{phase}"),
prev_phase: budget.phases&.last,
starts_at: budget.phases&.last&.ends_at || Date.current,
ends_at: (budget.phases&.last&.ends_at || Date.current) + 1.month
)
end
end
end
end
end