Files
grecia/app/components/admin/budget_headings/form_component.rb
Matheus Miranda de13e789dd Add polygon geographies to Budgets' map
Note that in the budgets wizard test we now create district with no
associated geozone, so the text "all city" will appear in the districts
table too, meaning we can't use `within "section", text: "All city" do`
anymore since it would result in an ambiguous match.

Co-Authored-By: Julian Herrero <microweb10@gmail.com>
Co-Authored-By: Javi Martín <javim@elretirao.net>
2023-05-31 16:56:15 +02:00

26 lines
534 B
Ruby

class Admin::BudgetHeadings::FormComponent < ApplicationComponent
include TranslatableFormHelper
include GlobalizeHelper
attr_reader :heading, :path, :action
def initialize(heading, path:, action:)
@heading = heading
@path = path
@action = action
end
private
def budget
heading.budget
end
def single_heading?
helpers.respond_to?(:single_heading?) && helpers.single_heading?
end
def geozone_options
Geozone.all.map { |geozone| [geozone.name, geozone.id] }
end
end