Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class MySQL2Spatial < MySQL
end

FUNC_MAP = {
'st_wkttosql' => 'GeomFromText',
'st_wkbtosql' => 'GeomFromWKB',
'st_length' => 'GLength'
}.freeze
'st_wkttosql' => 'ST_GeomFromText',
'st_wkbtosql' => 'ST_GeomFromWKB',
'st_length' => 'ST_GLength'
}

include ::RGeo::ActiveRecord::SpatialToSql

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def point(name, options = {})
end
end

ConnectionAdapters::TableDefinition.include ColumnMethods
ConnectionAdapters::TableDefinition.send(:include, ColumnMethods)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def native_database_types

def quote(value_, column_ = nil)
if ::RGeo::Feature::Geometry.check_type(value_)
"GeomFromWKB(0x#{::RGeo::WKRep::WKBGenerator.new(hex_format: true).generate(value_)},#{value_.srid})"
"ST_GeomFromWKB(0x#{::RGeo::WKRep::WKBGenerator.new(hex_format: true).generate(value_)},#{value_.srid})"
else
super
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ module Mysql2SpatialAdapter
ConnectionAdapters::Mysql2Adapter::Column : ConnectionAdapters::Mysql2Column

class SpatialColumn < column_base_class_
FACTORY_SETTINGS_CACHE = {}.freeze

FACTORY_SETTINGS_CACHE = {}
def initialize(factory_settings_, table_name_, name_, default_, sql_type_ = nil, null_ = true)
@factory_settings = factory_settings_
@table_name = table_name_
Expand Down