Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition

Inherits:
TableDefinition
  • Object
show all
Includes:
ColumnMethods
Defined in:
lib/activerecord-postgres-postgis/active_record/connection_adapters/schema_definitions.rb

Instance Method Summary collapse

Methods included from ColumnMethods

#geography, #geometry

Instance Method Details

#column_with_spatial(name, type = nil, options = {}) ⇒ Object



35
36
37
38
39
40
# File 'lib/activerecord-postgres-postgis/active_record/connection_adapters/schema_definitions.rb', line 35

def column_with_spatial(name, type = nil, options = {})
  column = column_without_spatial(name, type, options)[name]
  column.spatial_type = options[:spatial_type]
  column.srid = options[:srid]
  self
end