Éviter de tenter créer une geometry du mauvais type
Sentry Issue: COCARTO-5Z
PG::InvalidParameterValue: ERROR: Geometry type (Point) does not match column type (Polygon) (PG::InvalidParameterValue)
app/controllers/rows_controller.rb:31:in `create'
@row = authorize Row.create(layer: @layer, **row_params(@layer.fields), author: current_user)
app/services/batch_row_broadcast.rb:45:in `block in perform_transaction'
yield
app/services/batch_row_broadcast.rb:44:in `perform_transaction'
ApplicationRecord.transaction do
app/services/batch_row_broadcast.rb:16:in `transaction'
analyser.perform_transaction(&)
app/controllers/rows_controller.rb:76:in `batch_broadcast'
BatchRowBroadcast.transaction(&block)
...
(145 additional frame(s) were not displayed)
ActiveRecord::StatementInvalid: PG::InvalidParameterValue: ERROR: Geometry type (Point) does not match column type (Polygon) (ActiveRecord::StatementInvalid)
Simple à reproduire:
- Sélectionner un layer de type point
- Cliquer sur le bouton “Ajouter un point” (mais ne pas cliquer sur la carte)
- Sélectionner un layer de type polygone (ou en tout cas d’un autre type qu’à l’étape 1)
- Cliquer sur la carte