Skip to content

Handle polygon_geojson read/write for JSONB compatibility#3003

Open
benbaumann95 wants to merge 1 commit intomainfrom
neighbour-geojson
Open

Handle polygon_geojson read/write for JSONB compatibility#3003
benbaumann95 wants to merge 1 commit intomainfrom
neighbour-geojson

Conversation

@benbaumann95
Copy link
Copy Markdown
Member

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

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.
end_date >= Time.zone.today
end

def polygon_geojson
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to do a data migration for legacy data stored as strings?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants