Add non-prefixed polymorphic admin routes

These routes are solved in a different way because of an inconsistency:
we define `groups` and `budget_investments`; we should either use the
`budget_` prefix in all places or remove it everywhere.

We can now share code using `polymorphic_path` even with these models.
This commit is contained in:
Javi Martín
2020-06-06 19:04:51 +02:00
parent 7563b7f4d1
commit 65604a92c2
4 changed files with 88 additions and 4 deletions

View File

@@ -265,3 +265,23 @@ end
resolve "Audit" do |audit|
[*resource_hierarchy_for(audit.associated || audit.auditable), audit]
end
resolve "Budget::Group" do |group, options|
[group.budget, :group, options.merge(id: group)]
end
resolve "Budget::Heading" do |heading, options|
[heading.budget, :group, :heading, options.merge(group_id: heading.group, id: heading)]
end
resolve "Poll::Booth" do |booth, options|
[:booth, options.merge(id: booth)]
end
resolve "Poll::Officer" do |officer, options|
[:officer, options.merge(id: officer)]
end
resolve "Poll::Question::Answer::Video" do |video, options|
[:video, options.merge(id: video)]
end