Skip to content

Commit

Permalink
fm - adding schema dumper support for scale and precision attributes …
Browse files Browse the repository at this point in the history
…used by the decimal data type

Signed-off-by: Pete Deffendol <pete@mdsc.com>
  • Loading branch information
Felix Morio authored and Pete Deffendol committed Jul 21, 2009
1 parent f90868c commit 1452247
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.rdoc
Expand Up @@ -2,6 +2,10 @@

This is the Spatial Adapter for Rails 0.1.1. It is a plugin for Rails which manages the MySql Spatial and PostGIS geometric columns in a transparent way (that is like the other base data type columns). It also provides a way to manage these columns in migrations. It replaces both the "PostGIS Adapter for Rails" and "MySql Spatial Adapter for Rails" plugins.

== Last modified

Last modified/forked from fragility/spatial_adapter by Felix Morio 06/30/2009.

== Dependencies

You need to install a version >= 0.1.1 of the GeoRuby gem (http://rubyforge.org/projects/georuby/):
Expand Down
4 changes: 3 additions & 1 deletion lib/common_spatial_adapter.rb
Expand Up @@ -52,7 +52,9 @@ def table(table, stream)
else
tbl.print " t.column #{column.name.inspect}, #{column.type.inspect}"
end
tbl.print ", :limit => #{column.limit.inspect}" if column.limit != @types[column.type][:limit]
tbl.print ", :limit => #{column.limit.inspect}" if column.limit != @types[column.type][:limit] && column.precision.blank? && column.scale.blank?
tbl.print ", :precision => #{column.precision.inspect}" if column.precision != @types[column.type][:precision]
tbl.print ", :scale => #{column.scale.inspect}" if column.scale != @types[column.type][:scale]
tbl.print ", :default => #{column.default.inspect}" if !column.default.nil?
tbl.print ", :null => false" if !column.null
tbl.puts
Expand Down

0 comments on commit 1452247

Please sign in to comment.