Module: PostgresExt::Postgis::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition

Includes:
ColumnMethods
Defined in:
lib/postgres_ext/postgis/active_record/connection_adapters/postgresql_adapter.rb

Instance Method Summary collapse

Methods included from ColumnMethods

#geometry

Instance Method Details

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



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/postgres_ext/postgis/active_record/connection_adapters/postgresql_adapter.rb', line 45

def column(name, type, options = {})
  super
  column = self[name]

  if type.to_s == 'geometry'
    column.srid = options[:srid]
    column.spatial_type = options[:spatial_type]
  end

  self
end