Class: ActiveRecord::ConnectionAdapters::PostgreSQLColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord-spatial/active_record/connection_adapters/postgresql/adapter_extensions.rb

Instance Method Summary collapse

Instance Method Details

#simplified_type_with_spatial_type(field_type) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/activerecord-spatial/active_record/connection_adapters/postgresql/adapter_extensions.rb', line 7

def simplified_type_with_spatial_type(field_type)
  case field_type
    # This is a special internal type used by PostgreSQL. In this case,
    # it is being used by the `geography_columns` view in PostGIS.
    when 'name'
      :string
    when /^geometry(\(|$)/
      :geometry
    when /^geography(\(|$)/
      :geography
    else
      simplified_type_without_spatial_type(field_type)
  end
end