Class: ActiveRecord::ConnectionAdapters::PostgreSQLTableDefinition

Inherits:
TableDefinition
  • Object
show all
Defined in:
lib/postgis_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#geom_columnsObject (readonly)

Returns the value of attribute geom_columns.



316
317
318
# File 'lib/postgis_adapter.rb', line 316

def geom_columns
  @geom_columns
end

Instance Method Details

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



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/postgis_adapter.rb', line 318

def column(name, type, options = {})
  unless (@base.geometry_data_types[type.to_sym].nil? or
          (options[:create_using_addgeometrycolumn] == false))

    geom_column = PostgreSQLColumnDefinition.new(@base,name, type)
    geom_column.null = options[:null]
    geom_column.srid = options[:srid] || -1
    geom_column.with_z = options[:with_z] || false
    geom_column.with_m = options[:with_m] || false

    @geom_columns = [] if @geom_columns.nil?
    @geom_columns << geom_column
  else
    super(name,type,options)
  end
end