feat(export.xslx): add code commune to geo_area.label
This commit is contained in:
parent
3fd6e0b7b0
commit
eae05b0a6f
4 changed files with 4 additions and 4 deletions
|
@ -73,7 +73,7 @@ class GeoArea < ApplicationRecord
|
|||
def label
|
||||
case source
|
||||
when GeoArea.sources.fetch(:cadastre)
|
||||
I18n.t("cadastre", scope: 'geo_area.label', numero: numero, prefixe: prefixe, section: section, surface: surface.round)
|
||||
I18n.t("cadastre", scope: 'geo_area.label', numero: numero, prefixe: prefixe, section: section, surface: surface.round, commune: commune)
|
||||
when GeoArea.sources.fetch(:selection_utilisateur)
|
||||
if polygon?
|
||||
if area > 0
|
||||
|
|
|
@ -8,7 +8,7 @@ en:
|
|||
selection_utilisateur: User selection
|
||||
geo_area:
|
||||
label:
|
||||
cadastre: "Parcel n° %{numero} - Sheet %{prefixe} %{section} - %{surface} m²"
|
||||
cadastre: "Parcel n° %{numero} - Sheet %{prefixe} %{section} - %{surface} m² - town %{commune}"
|
||||
area: "An area of %{area} m²"
|
||||
area_unknown: "An area of unknown surface"
|
||||
line: "A %{length} m long line"
|
||||
|
|
|
@ -8,7 +8,7 @@ fr:
|
|||
selection_utilisateur: Sélection utilisateur
|
||||
geo_area:
|
||||
label:
|
||||
cadastre: "Parcelle n° %{numero} - Feuille %{prefixe} %{section} - %{surface} m²"
|
||||
cadastre: "Parcelle n° %{numero} - Feuille %{prefixe} %{section} - %{surface} m² – commune %{commune}"
|
||||
area: "Une aire de surface %{area} m²"
|
||||
area_unknown: "Une aire de surface inconnue"
|
||||
line: "Une ligne longue de %{length} m"
|
||||
|
|
|
@ -140,7 +140,7 @@ RSpec.describe GeoArea, type: :model do
|
|||
context "when geo is a cadastre parcelle" do
|
||||
let(:geo_area) { build(:geo_area, :selection_utilisateur, :cadastre, champ: nil) }
|
||||
it "should return the label" do
|
||||
expect(geo_area.label).to eq("Parcelle n° 42 - Feuille 000 A11 - 123 m²")
|
||||
expect(geo_area.label).to eq("Parcelle n° 42 - Feuille 000 A11 - 123 m² – commune 75127")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue