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>
26 lines
486 B
Ruby
26 lines
486 B
Ruby
class Admin::BudgetHeadings::HeadingsComponent < ApplicationComponent
|
|
attr_reader :headings
|
|
|
|
def initialize(headings)
|
|
@headings = headings
|
|
end
|
|
|
|
private
|
|
|
|
def group
|
|
@group ||= headings.proxy_association.owner
|
|
end
|
|
|
|
def budget
|
|
@budget ||= group.budget
|
|
end
|
|
|
|
def geozone_for(heading)
|
|
if heading.geozone
|
|
link_to heading.geozone.name, edit_admin_geozone_path(heading.geozone)
|
|
else
|
|
t("geozones.none")
|
|
end
|
|
end
|
|
end
|