mysql_point 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc2612e36becbac4abe561f588e43c3772f19428
4
- data.tar.gz: 86a04677384baeabdca0ea45168f550b0ca85a3e
3
+ metadata.gz: 9d474d47a3a5e5e18e4b5ea48dd5df54181a5a2c
4
+ data.tar.gz: a1944b6bbb2c5b13eae1ace46d222721526bdab4
5
5
  SHA512:
6
- metadata.gz: a0d08140c94000a0506b7c113e11af236baa128dc1d1f41786464d039bc7a5ba6caf7f0dd850fc7741765eec40ce1f388522553fcbb1f953d7010ca78a1153c1
7
- data.tar.gz: 647e13ac125c70d452b4313fbadb0efa898e2001ed1ffd73a73a6d061bd366c88f5a973cb0c7434d24212c3ce46cced363b92923c09062e95c287ddb4b1130ae
6
+ metadata.gz: 2cd5dd31e3b36077f7d64c2eef46bbb4620625be56ddb8e3bc3976919172ae60484df97eb39e0901f92a8bc1a41facfead1fd019bf293b122c6b9d335c380c46
7
+ data.tar.gz: e2bdc8e26ff07d73bbf964f5fba06cf2edc38867c70ff7a6324a95445f70aa7edd3286ba55d4b1b8893b183f0e4a50884cff80bd407b22bd6bb506d22c0c2ae3
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Provides basic ActiveRecord support for MySQL `point` fields. This becomes useful in MySQL 5.7.6, which adds [`ST_DISTANCE_SPHERE`](https://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html#function_st-distance-sphere) for practical distance-between-points-on-Earth calculations.
4
4
 
5
+ [![Gem](https://img.shields.io/gem/v/mysql_point.svg)](https://rubygems.org/gems/mysql_point)[![master branch](https://img.shields.io/circleci/project/github/EmpaticoOrg/mysql_point.svg)](https://circleci.com/gh/EmpaticoOrg/mysql_point/tree/master)
6
+
5
7
  ## Features
6
8
 
7
9
  Included:
@@ -0,0 +1,9 @@
1
+ require_relative 'type'
2
+
3
+ module MySQLPoint::TypeMap
4
+ private def initialize_type_map(m)
5
+ super.tap do
6
+ m.register_type(/^point/, MySQLPoint::Type.new)
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module MySQLPoint
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/lib/mysql_point.rb CHANGED
@@ -8,12 +8,12 @@ require_relative 'mysql_point/coordinate'
8
8
  require_relative 'coordinate_validator'
9
9
 
10
10
  # enables column type in ActiveRecord
11
- require_relative 'mysql_point/type'
12
- ActiveRecord::Base.connection.type_map.register_type(/^point/, MySQLPoint::Type.new)
11
+ require_relative 'mysql_point/type_map'
12
+ ActiveRecord::ConnectionAdapters::Mysql2Adapter.prepend MySQLPoint::TypeMap
13
13
 
14
14
  # enables a Coordinate to be sent as WKT and converted by a MySQL function on insert/update
15
15
  require_relative 'mysql_point/quoting'
16
- ActiveRecord::Base.connection.class.prepend MySQLPoint::Quoting
16
+ ActiveRecord::ConnectionAdapters::Mysql2Adapter.prepend MySQLPoint::Quoting
17
17
 
18
18
  # enables shorthand syntax in migrations and db/schema.rb
19
19
  require_relative 'mysql_point/column_method'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql_point
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lance Ivy
@@ -120,6 +120,7 @@ files:
120
120
  - lib/mysql_point/coordinate.rb
121
121
  - lib/mysql_point/quoting.rb
122
122
  - lib/mysql_point/type.rb
123
+ - lib/mysql_point/type_map.rb
123
124
  - lib/mysql_point/version.rb
124
125
  - mysql_point.gemspec
125
126
  homepage: https://github.com/empaticoorg/mysql_point