Sha256: 64c824699998739ea9982b2200b72fb5898d7bb849e102bf8e722e5efe405570

Contents?: true

Size: 1021 Bytes

Versions: 3

Compression:

Stored size: 1021 Bytes

Contents

require 'active_record'

module MySQLPoint
end

require_relative 'mysql_point/version'
require_relative 'mysql_point/coordinate'
require_relative 'coordinate_validator'

# enables column type in ActiveRecord
require 'active_record/connection_adapters/mysql2_adapter'
require_relative 'mysql_point/type_map'
ActiveRecord::ConnectionAdapters::Mysql2Adapter.prepend MySQLPoint::TypeMap

# enables a Coordinate to be sent as WKT and converted by a MySQL function on insert/update
require_relative 'mysql_point/quoting'
ActiveRecord::ConnectionAdapters::Mysql2Adapter.prepend MySQLPoint::Quoting

# enables shorthand syntax in migrations and db/schema.rb
require_relative 'mysql_point/column_method'
ActiveRecord::ConnectionAdapters::MySQL::TableDefinition.include MySQLPoint::ColumnMethod
ActiveRecord::ConnectionAdapters::MySQL::Table.include MySQLPoint::ColumnMethod

# enables schema dumping into migration syntax
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES[:point] = {
  name: 'point'
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mysql_point-1.0.4 lib/mysql_point.rb
mysql_point-1.0.3 lib/mysql_point.rb
mysql_point-1.0.2 lib/mysql_point.rb