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.



351
352
353
# File 'lib/postgis_adapter.rb', line 351

def geom_columns
  @geom_columns
end

Instance Method Details

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



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/postgis_adapter.rb', line 353

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