activerecord-postgis 0.6.1 → 0.6.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c4caab5fe6b63c11ebb789f2e77cb8997ac1c495333cc08e2cba397e043916fa
|
|
4
|
+
data.tar.gz: a8688b2c439daf278f07fe7c9ff00fd791ef82f964a74f0032ec088e5a495144
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55b212ec58aff548cd55062d88728b75383859b246a66cd49cda54e1f86d2acde0ad3b6a3df8d921e4e7678efe99c9898f78efa4557e978b9361e520996bd823
|
|
7
|
+
data.tar.gz: 5c33782d1350c14a8f8bf1edbe3ae8495bd40527293241f80e5d6b140f964c70b953d2f3fc8b513a1c5df8fb218c896540d6fcc80645ef4573c7e7460abc11e0
|
|
@@ -25,9 +25,9 @@ module ActiveRecord
|
|
|
25
25
|
has_z = geo_part.end_with?("Z") || geo_part.end_with?("ZM")
|
|
26
26
|
has_m = geo_part.end_with?("M") || geo_part.end_with?("ZM")
|
|
27
27
|
end
|
|
28
|
-
elsif o.limit.is_a?(String) && o.limit.include?(",")
|
|
28
|
+
elsif o.options[:limit].is_a?(String) && o.options[:limit].include?(",")
|
|
29
29
|
# Fallback to parsing limit string (for schema loading)
|
|
30
|
-
geo_part, srid_part = o.limit.split(",", 2)
|
|
30
|
+
geo_part, srid_part = o.options[:limit].split(",", 2)
|
|
31
31
|
srid = srid_part.to_i if srid_part && !srid_part.empty?
|
|
32
32
|
if geo_part
|
|
33
33
|
has_z = geo_part.end_with?("Z") || geo_part.end_with?("ZM")
|
|
@@ -42,9 +42,9 @@ module ActiveRecord
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
sql_type = type_to_sql(o.type.to_sym,
|
|
45
|
-
limit: o.options[:spatial_sql] || o.limit,
|
|
46
|
-
precision: o.precision,
|
|
47
|
-
scale: o.scale,
|
|
45
|
+
limit: o.options[:spatial_sql] || o.options[:limit],
|
|
46
|
+
precision: o.options[:precision],
|
|
47
|
+
scale: o.options[:scale],
|
|
48
48
|
srid: srid,
|
|
49
49
|
geographic: geographic,
|
|
50
50
|
has_z: has_z,
|
|
@@ -22,8 +22,9 @@ module ActiveRecord
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
if spatial_column_type?(col_type)
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
case (limit = options.delete(:limit))
|
|
26
|
+
when ::Hash then options.merge!(limit)
|
|
27
|
+
when ::String then options.reverse_merge!(ColumnDefinitionUtils.options_from_limit(limit))
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
# Set geographic option for geography types
|
|
@@ -125,6 +126,17 @@ module ActiveRecord
|
|
|
125
126
|
end
|
|
126
127
|
end
|
|
127
128
|
|
|
129
|
+
# Inverse of limit_from_options: "POINTZ,4326" => { srid: 4326, has_z: true }
|
|
130
|
+
def options_from_limit(limit)
|
|
131
|
+
geo_part, srid_part = limit.split(",", 2)
|
|
132
|
+
dimensions = geo_part.to_s.upcase[/(ZM|Z|M)\z/].to_s
|
|
133
|
+
options = {}
|
|
134
|
+
options[:srid] = Integer(srid_part) if srid_part.present?
|
|
135
|
+
options[:has_z] = true if dimensions.include?("Z")
|
|
136
|
+
options[:has_m] = true if dimensions.include?("M")
|
|
137
|
+
options
|
|
138
|
+
end
|
|
139
|
+
|
|
128
140
|
def limit_from_options(type, options = {})
|
|
129
141
|
has_z = options[:has_z] ? "Z" : ""
|
|
130
142
|
has_m = options[:has_m] ? "M" : ""
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-postgis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abdelkader Boudih
|
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
137
|
version: '0'
|
|
138
138
|
requirements: []
|
|
139
|
-
rubygems_version: 4.0.
|
|
139
|
+
rubygems_version: 4.0.20
|
|
140
140
|
specification_version: 4
|
|
141
141
|
summary: PostGIS Type support for ActiveRecord
|
|
142
142
|
test_files: []
|