activerecord-postgis-adapter 5.2.1 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/active_record/connection_adapters/postgis/arel_tosql.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/column_methods.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/create_connection.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/databases.rake +2 -0
- data/lib/active_record/connection_adapters/postgis/oid/spatial.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/postgis_database_tasks.rb +8 -2
- data/lib/active_record/connection_adapters/postgis/railtie.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/schema_statements.rb +6 -2
- data/lib/active_record/connection_adapters/postgis/setup.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/spatial_column.rb +4 -1
- data/lib/active_record/connection_adapters/postgis/spatial_column_info.rb +5 -1
- data/lib/active_record/connection_adapters/postgis/spatial_table_definition.rb +2 -0
- data/lib/active_record/connection_adapters/postgis/version.rb +3 -1
- data/lib/active_record/connection_adapters/postgis_adapter.rb +3 -1
- data/lib/activerecord-postgis-adapter.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6467b540dc2494cfe0add8a78d7d04258c6ae7a64b32ef397d7b58703b961d8
|
4
|
+
data.tar.gz: 508f828273255798e15451a683d331c7488fb2d0840f92ba5dccb7c7d97f2f9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198647715bc7f7ed32b996e1dc5be24019d27c65b3cf3085b1b09d0544052b0f302aff527e58de2e75fd43964365af79044f512ee10575102284f82a489222d0
|
7
|
+
data.tar.gz: dbe312d6930f13c271a0ee82312e05966e645c7d77edb2dd31643e5277b3de755b35f0d55e7e5704ba56ea47a9d10efbb0e57b7b67e9019bb19366fadd2fd579
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActiveRecord # :nodoc:
|
2
4
|
module ConnectionAdapters # :nodoc:
|
3
5
|
module PostGIS # :nodoc:
|
@@ -106,7 +108,9 @@ module ActiveRecord # :nodoc:
|
|
106
108
|
def setup_gis_from_extension
|
107
109
|
extension_names.each do |extname|
|
108
110
|
if extname == "postgis_topology"
|
109
|
-
|
111
|
+
unless search_path.include?("topology")
|
112
|
+
raise ArgumentError, "'topology' must be in schema_search_path for postgis_topology"
|
113
|
+
end
|
110
114
|
connection.execute("CREATE EXTENSION IF NOT EXISTS #{extname} SCHEMA topology")
|
111
115
|
else
|
112
116
|
if (postgis_schema = configuration["postgis_schema"])
|
@@ -125,7 +129,9 @@ module ActiveRecord # :nodoc:
|
|
125
129
|
end
|
126
130
|
|
127
131
|
def schema_exists?(schema_name)
|
128
|
-
connection.execute(
|
132
|
+
connection.execute(
|
133
|
+
"SELECT schema_name FROM information_schema.schemata WHERE schema_name = '#{schema_name}'"
|
134
|
+
).any?
|
129
135
|
end
|
130
136
|
end
|
131
137
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActiveRecord
|
2
4
|
module ConnectionAdapters
|
3
5
|
module PostGIS
|
@@ -14,12 +16,14 @@ module ActiveRecord
|
|
14
16
|
default_value = extract_value_from_default(default)
|
15
17
|
|
16
18
|
default_function = extract_default_function(default_value, default)
|
17
|
-
new_column(table_name, column_name, default_value, cast_type, type_metadata, !notnull,
|
19
|
+
new_column(table_name, column_name, default_value, cast_type, type_metadata, !notnull,
|
20
|
+
default_function, collation, comment)
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
21
24
|
# override
|
22
|
-
def new_column(table_name, column_name, default, cast_type, sql_type_metadata = nil,
|
25
|
+
def new_column(table_name, column_name, default, cast_type, sql_type_metadata = nil,
|
26
|
+
null = true, default_function = nil, collation = nil, comment = nil)
|
23
27
|
# JDBC gets true/false in Rails 4, where other platforms get 't'/'f' strings.
|
24
28
|
if null.is_a?(String)
|
25
29
|
null = (null == "t")
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActiveRecord # :nodoc:
|
2
4
|
module ConnectionAdapters # :nodoc:
|
3
5
|
module PostGIS # :nodoc:
|
@@ -8,7 +10,8 @@ module ActiveRecord # :nodoc:
|
|
8
10
|
# cast_type example classes:
|
9
11
|
# OID::Spatial
|
10
12
|
# OID::Integer
|
11
|
-
def initialize(name, default, sql_type_metadata = nil, null = true, table_name = nil,
|
13
|
+
def initialize(name, default, sql_type_metadata = nil, null = true, table_name = nil,
|
14
|
+
default_function = nil, collation = nil, comment = nil, cast_type = nil, opts = nil)
|
12
15
|
@cast_type = cast_type
|
13
16
|
@geographic = !!(sql_type_metadata.sql_type =~ /geography\(/i)
|
14
17
|
if opts
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActiveRecord # :nodoc:
|
2
4
|
module ConnectionAdapters # :nodoc:
|
3
5
|
module PostGIS
|
@@ -9,7 +11,9 @@ module ActiveRecord # :nodoc:
|
|
9
11
|
end
|
10
12
|
|
11
13
|
def all
|
12
|
-
info = @adapter.query(
|
14
|
+
info = @adapter.query(
|
15
|
+
"SELECT f_geometry_column,coord_dimension,srid,type FROM geometry_columns WHERE f_table_name='#{@table_name}'"
|
16
|
+
)
|
13
17
|
result = {}
|
14
18
|
info.each do |row|
|
15
19
|
name = row[0]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# The activerecord-postgis-adapter gem installs the *postgis*
|
2
4
|
# connection adapter into ActiveRecord.
|
3
5
|
|
@@ -70,7 +72,7 @@ module ActiveRecord
|
|
70
72
|
end
|
71
73
|
|
72
74
|
def adapter_name
|
73
|
-
"PostGIS"
|
75
|
+
"PostGIS"
|
74
76
|
end
|
75
77
|
|
76
78
|
def self.spatial_column_options(key)
|
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.2.
|
4
|
+
version: 5.2.2
|
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: 2018-
|
11
|
+
date: 2018-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.7.
|
141
|
+
rubygems_version: 2.7.8
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: ActiveRecord adapter for PostGIS, based on RGeo.
|