Commit 9b743fa6 by Cuong Tran

Merge pull request #139 from keyme/support_more_postgis

support the PostGIS adapter
parents 5534a83f d6e4692e
...@@ -33,7 +33,7 @@ The schema comment looks like this: ...@@ -33,7 +33,7 @@ The schema comment looks like this:
. . . . . .
It also annotates geometrical columns, geom type and srid, when using It also annotates geometrical columns, geom type and srid, when using
`SpatialAdapter` or `PostgisAdapter`: `SpatialAdapter`, `PostgisAdapter` or `PostGISAdapter`:
# == Schema Info # == Schema Info
# #
...@@ -237,6 +237,7 @@ extra carefully, and consider using one. ...@@ -237,6 +237,7 @@ extra carefully, and consider using one.
- Fabrication: http://github.com/paulelliott/fabrication - Fabrication: http://github.com/paulelliott/fabrication
- SpatialAdapter: http://github.com/pdeffendol/spatial_adapter - SpatialAdapter: http://github.com/pdeffendol/spatial_adapter
- PostgisAdapter: http://github.com/nofxx/postgis_adapter - PostgisAdapter: http://github.com/nofxx/postgis_adapter
- PostGISAdapter: https://github.com/dazuma/activerecord-postgis-adapter
== License == License
......
...@@ -118,7 +118,7 @@ module AnnotateModels ...@@ -118,7 +118,7 @@ module AnnotateModels
col_type = (col.type || col.sql_type).to_s col_type = (col.type || col.sql_type).to_s
if col_type == "decimal" if col_type == "decimal"
col_type << "(#{col.precision}, #{col.scale})" col_type << "(#{col.precision}, #{col.scale})"
else elsif col_type != "spatial"
if (col.limit) if (col.limit)
if col.limit.is_a? Array if col.limit.is_a? Array
attrs << "(#{col.limit.join(', ')})" attrs << "(#{col.limit.join(', ')})"
...@@ -132,6 +132,8 @@ module AnnotateModels ...@@ -132,6 +132,8 @@ module AnnotateModels
# and print the type and SRID # and print the type and SRID
if col.respond_to?(:geometry_type) if col.respond_to?(:geometry_type)
attrs << "#{col.geometry_type}, #{col.srid}" attrs << "#{col.geometry_type}, #{col.srid}"
elsif col.respond_to?(:geometric_type) and col.geometric_type.present?
attrs << "#{col.geometric_type.to_s.downcase}, #{col.srid}"
end end
# Check if the column has indices and print "indexed" if true # Check if the column has indices and print "indexed" if true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment