-
-
Notifications
You must be signed in to change notification settings - Fork 254
Open
Description
i have a postgres enum type with point
in the name. this column is falsely being identified with @geometric_type=RGeo::Feature::Geometry
even though @geographic=false
:
#<ActiveRecord::ConnectionAdapters::PostGIS::SpatialColumn:0x0000000163a36880
@collation=nil,
@comment=nil,
@default=nil,
@default_function=nil,
@generated="",
@geographic=false,
@geometric_type=RGeo::Feature::Geometry,
@has_m=false,
@has_z=false,
@identity=nil,
@name="waypoint_type",
@null=false,
@serial=nil,
@sql_type_metadata=#<ActiveRecord::ConnectionAdapters::SqlTypeMetadata:0x0000000163f12e58 @limit=nil, @precision=nil, @scale=nil, @sql_type="waypoint_type", @type=:enum>,
@srid=0>
and this causes a weird interplay with annotaterb which then adds the following to my model:
# waypoint_type :enum not null, geometry, 0
i believe the issue is in this code:
activerecord-postgis-adapter/lib/active_record/connection_adapters/postgis/spatial_column.rb
Lines 28 to 32 in 5d380da
elsif sql_type_metadata.sql_type =~ /geography|geometry|point|linestring|polygon/i | |
# A geometry column with no geometry_columns entry. | |
# @geometric_type = geo_type_from_sql_type(sql_type) | |
build_from_sql_type(sql_type_metadata.sql_type) | |
end |
it seems like this would fix it
elsif sql_type_metadata.type != :enum && sql_type_metadata.sql_type =~ /geography|geometry|point|linestring|polygon/i
i'm going to open a pr and try it.
Metadata
Metadata
Assignees
Labels
No labels