Class: ActiveRecord::ConnectionAdapters::OracleTableDefinition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#geom_columnsObject (readonly)

Returns the value of attribute geom_columns.



293
294
295
# File 'lib/spatial_adapter/oracle_enhanced.rb', line 293

def geom_columns
  @geom_columns
end

Instance Method Details

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



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/spatial_adapter/oracle_enhanced.rb', line 295

def column(name, type, options = {})
  unless @base.geometry_data_types[type.to_sym].nil?
    geom_column = OracleColumnDefinition.new(@base, name, type)
    geom_column.null = options[:null]
    srid = options[:srid] || -1
    srid = @base.default_srid if srid == :default_srid
    geom_column.srid = srid
    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