Do not crash on boot if geos is not installed
This commit is contained in:
parent
04cf174039
commit
2a3530738d
3 changed files with 2 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue