-
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
I'd expect multi geoms to be bound / cast (?) as a multi geoms in active record:
multi_geom = RGeo::Geos.factory.parse_wkt("MULTIPOLYGON (((0 0, 0 1, 1 1, 0 0)),((1 1, 0 0, 0 1, 1 1)))")
ApplicationRecord.send(:quote_bound_value, multi_geom)
=> "'00200000030000000000000001000000040000000000000000000000000000000000000000000000003ff00000000000003ff00000000000003ff000000000000000000000000000000000000000000000','00200000030000000000000001000000043ff00000000000003ff00000000000000000000000000000000000000000000000000000000000003ff00000000000003ff00000000000003ff0000000000000'"To get a proper multi-geom I have to wrap it in an array
ApplicationRecord.send(:quote_bound_value, [multi_geom])
=> "'00200000060000000000000002000000000300000001000000040000000000000000000000000000000000000000000000003ff00000000000003ff00000000000003ff000000000000000000000000000000000000000000000000000000300000001000000043ff00000000000003ff00000000000000000000000000000000000000000000000000000000000003ff00000000000003ff00000000000003ff0000000000000'" This is because AR checks if a method responds to map here
Not sure how best to solve this without some nasty monkey patch
Metadata
Metadata
Assignees
Labels
No labels