<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -211,12 +211,20 @@ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
     raw_geom_infos = column_spatial_info(table_name)
     
     column_definitions(table_name).collect do |name, type, default, notnull|
-      if type =~ /geometry/i and raw_geom_infos[name]
+      if type =~ /geometry/i
         raw_geom_info = raw_geom_infos[name]
         if ActiveRecord::VERSION::STRING &gt;= &quot;2.0.0&quot;
-          ActiveRecord::ConnectionAdapters::SpatialPostgreSQLColumn.new(name, default,raw_geom_info.type, notnull == &quot;f&quot;, raw_geom_info.srid, raw_geom_info.with_z, raw_geom_info.with_m)
+          if raw_geom_info.nil?
+             ActiveRecord::ConnectionAdapters::SpatialPostgreSQLColumn.create_simplified(name,default,notnull == &quot;f&quot;)
+          else
+            ActiveRecord::ConnectionAdapters::SpatialPostgreSQLColumn.new(name, default,raw_geom_info.type, notnull == &quot;f&quot;, raw_geom_info.srid, raw_geom_info.with_z, raw_geom_info.with_m)
+          end
         else
-          ActiveRecord::ConnectionAdapters::SpatialPostgreSQLColumn.new(name, default_value(default), raw_geom_info.type, notnull == &quot;f&quot;, raw_geom_info.srid, raw_geom_info.with_z, raw_geom_info.with_m)
+          if raw_geom_info.nil?
+            ActiveRecord::ConnectionAdapters::SpatialPostgreSQLColumn.create_simplified(name,default_value(default),notnull == &quot;f&quot;)
+          else
+            ActiveRecord::ConnectionAdapters::SpatialPostgreSQLColumn.new(name, default_value(default), raw_geom_info.type, notnull == &quot;f&quot;, raw_geom_info.srid, raw_geom_info.with_z, raw_geom_info.with_m)
+          end
         end
       else
         if ActiveRecord::VERSION::STRING &gt;= &quot;2.0.0&quot;
@@ -386,6 +394,11 @@ module ActiveRecord
         return string unless string.is_a?(String)
         GeoRuby::SimpleFeatures::Geometry.from_hex_ewkb(string) rescue nil
       end
+      
+      def self.create_simplified(name,default,null = true)
+        new(name,default,&quot;geometry&quot;,null,nil,nil,nil)
+      end
+
     end
   end
 end</diff>
      <filename>lib/post_gis_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -156,10 +156,10 @@ class MigrationPostgisTest &lt; Test::Unit::TestCase
     assert(pt.save)
 
     ActiveRecord::Base.connection.execute('CREATE VIEW viewparks as SELECT * from parks')
-    if not ActiveRecord::Base.connection.execute(&quot;select * from geometry_columns where f_table_name = 'viewparks' and f_geometry_column = 'geom'&quot;) #do not add if already there
+    #if not ActiveRecord::Base.connection.execute(&quot;select * from geometry_columns where f_table_name = 'viewparks' and f_geometry_column = 'geom'&quot;) #do not add if already there
       #mark the geom column in the view as geometric
-      ActiveRecord::Base.connection.execute(&quot;insert into geometry_columns values ('','public','viewparks','geom',2,-1,'POINT')&quot;)
-    end
+      #ActiveRecord::Base.connection.execute(&quot;insert into geometry_columns values ('','public','viewparks','geom',2,-1,'POINT')&quot;)
+    #end
 
     pt = Viewpark.find(:first)
     assert(pt)</diff>
      <filename>test/migration_postgis_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1ed5466abb0946c3b9d1442a9c601422bff7cc31</id>
    </parent>
  </parents>
  <author>
    <name>Guilhem Vellut</name>
    <email>guilhem.vellut+rubyforge@gmail.com</email>
  </author>
  <url>http://github.com/melriffe/spatial_adapter/commit/f2897b2e4a7ef85e102d2b18a7b7b89fc59b429b</url>
  <id>f2897b2e4a7ef85e102d2b18a7b7b89fc59b429b</id>
  <committed-date>2008-04-08T10:47:12-07:00</committed-date>
  <authored-date>2008-04-08T10:47:12-07:00</authored-date>
  <message>modif for views : no need anymore to add the column from the view to the geometry_columns table. when a geometry column for which there is no entry in geometry_columns is encountered (as is the case for views), some fields of the spatialcolumn structure are left blank (srid, with_m,with_z) and the actual geometry type of the column is assumed to be geometry (most general type). 



git-svn-id: http://georuby.rubyforge.org/svn/SpatialAdapter/trunk/spatial_adapter@115 7a115c08-5c0b-0410-86fa-965754e9f858</message>
  <tree>fa5152b3333edecac333c00da9fc36df5ab98f7a</tree>
  <committer>
    <name>Guilhem Vellut</name>
    <email>guilhem.vellut+rubyforge@gmail.com</email>
  </committer>
</commit>
