Change BudgetInvestmentStatus to Milestone::Status
Generalize the BudgetInvestmentStatus model to Milestone::Status so it is not specific to budget investments, but can be used for any entity which has milestones. This is in preparation to make the Milestone model polymorphic and usable by entities other than budget investments.
This commit is contained in:
@@ -139,16 +139,16 @@ section "Creating Valuation Assignments" do
|
||||
end
|
||||
end
|
||||
|
||||
section "Creating default Investment Milestone Statuses" do
|
||||
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.studying_project'))
|
||||
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.bidding'))
|
||||
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.executing_project'))
|
||||
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.executed'))
|
||||
section "Creating default Milestone Statuses" do
|
||||
Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.studying_project'))
|
||||
Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.bidding'))
|
||||
Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.executing_project'))
|
||||
Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.executed'))
|
||||
end
|
||||
|
||||
section "Creating investment milestones" do
|
||||
Budget::Investment.find_each do |investment|
|
||||
milestone = Budget::Investment::Milestone.new(investment_id: investment.id, publication_date: Date.tomorrow)
|
||||
milestone = Budget::Investment::Milestone.new(investment_id: investment.id, publication_date: Date.tomorrow, status_id: Milestone::Status.all.sample)
|
||||
I18n.available_locales.map do |locale|
|
||||
Globalize.with_locale(locale) do
|
||||
milestone.description = "Description for locale #{locale}"
|
||||
|
||||
Reference in New Issue
Block a user