activerecord-postgis-adapter 5.0.2 → 5.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/active_record/connection_adapters/postgis/column_methods.rb +2 -2
- data/lib/active_record/connection_adapters/postgis/oid/spatial.rb +2 -2
- data/lib/active_record/connection_adapters/postgis/railtie.rb +1 -4
- data/lib/active_record/connection_adapters/postgis/spatial_table_definition.rb +0 -2
- data/lib/active_record/connection_adapters/postgis/version.rb +1 -1
- data/lib/active_record/connection_adapters/postgis_adapter.rb +12 -4
- data/lib/activerecord-postgis-adapter.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 55d8ccb80a5af7b9cb4bdf9ccc538a17bb5049581c8e064ea32158ffa8087970
|
4
|
+
data.tar.gz: bc50927ccd18b0a6c17e6e73159cbc40b83a9e9bbcbe8c20a0265ad0915d091d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd1c8bdd0daedc8eb52c7d92a56468efe6efb93cfbd04468e00cafbf12899e47cbb0f087a59177e12f96e1b796cfa7f1afeba5f20e28435d9274cd7681ea2977
|
7
|
+
data.tar.gz: 826ff90f7b07ad036ca114e01ee2088a9bbcb5bb724099a77d49ea64ddd548e12112f1bae02b8a2b415488c03be3688e7fc7be7c86d7aa95078efff8fab8481e
|
@@ -24,9 +24,9 @@ module ActiveRecord
|
|
24
24
|
def self.parse_sql_type(sql_type)
|
25
25
|
geo_type, srid, has_z, has_m = nil, 0, false, false
|
26
26
|
|
27
|
-
if sql_type =~ /
|
27
|
+
if sql_type =~ /(geography|geometry)\((.*)\)$/i
|
28
28
|
# geometry(Point,4326)
|
29
|
-
params = Regexp.last_match(
|
29
|
+
params = Regexp.last_match(2).split(",")
|
30
30
|
if params.size > 1
|
31
31
|
if params.first =~ /([a-z]+[^zm])(z?)(m?)/i
|
32
32
|
has_z = Regexp.last_match(2).length > 0
|
@@ -1,12 +1,9 @@
|
|
1
|
-
require "rails/railtie"
|
2
|
-
require "active_record/connection_adapters/postgis_adapter"
|
3
|
-
|
4
1
|
module ActiveRecord # :nodoc:
|
5
2
|
module ConnectionAdapters # :nodoc:
|
6
3
|
module PostGIS # :nodoc:
|
7
4
|
class Railtie < ::Rails::Railtie # :nodoc:
|
8
5
|
rake_tasks do
|
9
|
-
load
|
6
|
+
load "active_record/connection_adapters/postgis/databases.rake"
|
10
7
|
end
|
11
8
|
end
|
12
9
|
end
|
@@ -14,8 +14,6 @@ module ActiveRecord # :nodoc:
|
|
14
14
|
geo_type = ColumnDefinitionUtils.geo_type(options[:type] || type || info[:type])
|
15
15
|
base_type = info[:type] || (options[:geographic] ? :geography : :geometry)
|
16
16
|
|
17
|
-
# puts name.dup << " - " << type.to_s << " - " << options.to_s << " :: " << geo_type.to_s << " - " << base_type.to_s
|
18
|
-
|
19
17
|
options[:limit] = ColumnDefinitionUtils.limit_from_options(geo_type, options)
|
20
18
|
options[:spatial_type] = geo_type
|
21
19
|
column = super(name, base_type, options)
|
@@ -3,8 +3,16 @@
|
|
3
3
|
|
4
4
|
# :stopdoc:
|
5
5
|
|
6
|
-
require "active_record/connection_adapters/postgresql_adapter"
|
7
6
|
require "rgeo/active_record"
|
7
|
+
|
8
|
+
# autoload AbstractAdapter to avoid circular require and void context warnings
|
9
|
+
module ActiveRecord
|
10
|
+
module ConnectionAdapters
|
11
|
+
AbstractAdapter
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
require "active_record/connection_adapters/postgresql_adapter"
|
8
16
|
require "active_record/connection_adapters/postgis/version"
|
9
17
|
require "active_record/connection_adapters/postgis/column_methods"
|
10
18
|
require "active_record/connection_adapters/postgis/schema_statements"
|
@@ -17,10 +25,10 @@ require "active_record/connection_adapters/postgis/oid/spatial"
|
|
17
25
|
require "active_record/connection_adapters/postgis/create_connection"
|
18
26
|
require "active_record/connection_adapters/postgis/postgis_database_tasks"
|
19
27
|
|
20
|
-
|
28
|
+
ActiveRecord::ConnectionAdapters::PostGIS.initial_setup
|
21
29
|
|
22
|
-
if defined?(
|
23
|
-
|
30
|
+
if defined?(Rails::Railtie)
|
31
|
+
require "active_record/connection_adapters/postgis/railtie"
|
24
32
|
end
|
25
33
|
|
26
34
|
# :startdoc:
|
@@ -1 +1 @@
|
|
1
|
-
require "active_record/connection_adapters/postgis_adapter
|
1
|
+
require "active_record/connection_adapters/postgis_adapter"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgis-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma, Tee Parham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -138,9 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.7.0
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: ActiveRecord adapter for PostGIS, based on RGeo.
|
145
145
|
test_files: []
|
146
|
-
has_rdoc:
|