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.
247 248 249 |
# File 'lib/spatial_adapter/postgresql.rb', line 247 def geom_columns @geom_columns end |
Instance Method Details
#column(name, type, options = {}) ⇒ Object
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/spatial_adapter/postgresql.rb', line 249 def column(name, type, = {}) unless (@base.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 |