Do not crash on boot if geos is not installed

This commit is contained in:
Paul Chavard 2020-04-23 16:16:22 +02:00
parent 04cf174039
commit 2a3530738d
3 changed files with 2 additions and 6 deletions

View file

@ -55,13 +55,13 @@ class GeoArea < ApplicationRecord
end
def area
if polygon?
if polygon? && RGeo::Geos.supported?
rgeo_geometry.area.round(1)
end
end
def length
if line?
if line? && RGeo::Geos.supported?
rgeo_geometry.length.round(1)
end
end