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:
|
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.
i have a postgres enum type with
pointin the name. this column is falsely being identified with@geometric_type=RGeo::Feature::Geometryeven though@geographic=false:and this causes a weird interplay with annotaterb which then adds the following to my model:
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
it seems like this would fix it
i'm going to open a pr and try it.