Class: ActiveRecord::ConnectionAdapters::Mysql2Rgeo::TableDefinition
- Inherits:
-
MySQL::TableDefinition
- Object
- MySQL::TableDefinition
- ActiveRecord::ConnectionAdapters::Mysql2Rgeo::TableDefinition
- Includes:
- ColumnMethods
- Defined in:
- lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb
Overview
:nodoc:
Instance Method Summary collapse
Methods included from ColumnMethods
#geometry, #geometry_collection, #line_string, #multi_line_string, #multi_point, #multi_polygon, #point, #polygon, #spatial
Instance Method Details
#new_column_definition(name, type, **options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb', line 9 def new_column_definition(name, type, **) if (info = Mysql2RgeoAdapter.(type.to_sym)) if (limit = .delete(:limit)) && limit.is_a?(::Hash) .merge!(limit) end geo_type = ColumnDefinitionUtils.geo_type([:type] || type || info[:type]) [:spatial_type] = geo_type column = super(name, geo_type.downcase.to_sym, **) else column = super(name, type, **) end column end |