always validate geometries returned from api

This commit is contained in:
Paul Chavard 2020-10-08 16:02:52 +02:00
parent 3fe1e75c36
commit 7c58f06c60
6 changed files with 104 additions and 46 deletions

View file

@ -20,6 +20,10 @@ class GeoAreaSerializer < ActiveModel::Serializer
attribute :surface, if: :include_parcelle_agricole?
attribute :bio, if: :include_parcelle_agricole?
def geometry
object.safe_geometry
end
def include_cadastre?
object.source == GeoArea.sources.fetch(:cadastre)
end