Class: ActiveRecord::ConnectionAdapters::PostgreSQLTableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::PostgreSQLTableDefinition
- Defined in:
- lib/spatial_adapter/postgresql.rb
Instance Attribute Summary collapse
-
#geom_columns ⇒ Object
readonly
Returns the value of attribute geom_columns.
Instance Method Summary collapse
Instance Attribute Details
#geom_columns ⇒ Object (readonly)
Returns the value of attribute geom_columns.
243 244 245 |
# File 'lib/spatial_adapter/postgresql.rb', line 243 def geom_columns @geom_columns end |
Instance Method Details
#column(name, type, options = {}) ⇒ Object
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/spatial_adapter/postgresql.rb', line 245 def column(name, type, = {}) unless (SpatialAdapter.geometry_data_types[type.to_sym].nil? or ([:create_using_addgeometrycolumn] == false)) column = self[name] || PostgreSQLColumnDefinition.new(@base, name, type) column.null = [:null] column.srid = [:srid] || -1 column.with_z = [:with_z] || false column.with_m = [:with_m] || false column.geographic = [:geographic] || false if column.geographic @columns << column unless @columns.include? column else # Hold this column for later @geom_columns ||= [] @geom_columns << column end self else super(name, type, ) end end |