Make Milestones general, and not specific to Budget Investments

Generalize the Budget::Investment::Milestone model to a
polymorphic Milestone model so it can be used for entities
other than Budget::Investment.
This commit is contained in:
Marko Lovic
2018-07-16 15:00:56 +02:00
committed by Javi Martín
parent 81f516efd7
commit c0f6fa182f
23 changed files with 176 additions and 122 deletions

View File

@@ -7,8 +7,8 @@ module ActionDispatch::Routing::UrlFor
case resource.class.name
when "Budget::Investment"
[resource.budget, resource]
when "Budget::Investment::Milestone"
[resource.investment.budget, resource.investment, resource]
when "Milestone"
[resource.milestoneable.budget, resource.milestoneable, resource]
when "Legislation::Annotation"
[resource.draft_version.process, resource.draft_version, resource]
when "Legislation::Proposal", "Legislation::Question", "Legislation::DraftVersion"