Handle polygon_geojson read/write for JSONB compatibility#3003
Open
benbaumann95 wants to merge 1 commit intomainfrom
Open
Handle polygon_geojson read/write for JSONB compatibility#3003benbaumann95 wants to merge 1 commit intomainfrom
benbaumann95 wants to merge 1 commit intomainfrom
Conversation
The geojson value was passed as a raw string to super, causing double-serialization in the JSONB column. Also guard against undefined EPSG:3857 data in the JS to prevent invalid submissions.
a024e9e to
bf0fa1a
Compare
benbaumann95
commented
Apr 13, 2026
| end_date >= Time.zone.today | ||
| end | ||
|
|
||
| def polygon_geojson |
Member
Author
There was a problem hiding this comment.
Maybe better to do a data migration for legacy data stored as strings?
Contributor
There was a problem hiding this comment.
For another recent change we did just wrap it like this (I forget which — one of @pixeltrix's)
But in this case, because it's the format change and there are performance benefits, I do wonder if properly migrating might be worthwhile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
The geojson value was passed as a raw string to super, causing double-serialization in the JSONB column. Also guard against undefined EPSG:3857 data in the JS to prevent invalid submissions.
Story Link
https://trello.com/c/3tk4NN0F/1909-neighbour-geojson-boundary-is-stored-as-a-string-in-the-jsonb-field-and-causes-errors-when-trying-to-re-read