activerecord-postgis-adapter 10.0.0 → 10.0.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/quoting.rb +18 -0
- data/lib/active_record/connection_adapters/postgis/spatial_column.rb +23 -0
- data/lib/active_record/connection_adapters/postgis/version.rb +1 -1
- data/lib/active_record/connection_adapters/postgis_adapter.rb +2 -1
- data/lib/activerecord-postgis-adapter.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 006fc33b47e59f9a1a422164e55ce515434cc0b73aa0ebbb6b001f42fcc9bed3
|
|
4
|
+
data.tar.gz: 2f83c9c9f633b1b7a1a82e9357637a310a893cf8d2c3c72b5b51bef1ef5c1e9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6af69ad49016381177399d46a31468828e0a5d9c556bb6193a33e6155f25590eb127f119069552eb11fb0ca56aa592c75f4c3d169430552ff8e216ffcdefce3
|
|
7
|
+
data.tar.gz: 51f47cb3c2ef75806e5104deaeb546542a8b0202f13fd6f6cf4a05ed605048b5cb1832e2f023d31af7092396283fb8ce8e34bfc26a5713182002c55164b0bfce
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActiveRecord
|
|
4
|
+
module ConnectionAdapters
|
|
5
|
+
module PostGIS
|
|
6
|
+
module Quoting
|
|
7
|
+
def type_cast(value)
|
|
8
|
+
case value
|
|
9
|
+
when RGeo::Feature::Instance
|
|
10
|
+
value.to_s
|
|
11
|
+
else
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -58,6 +58,29 @@ module ActiveRecord # :nodoc:
|
|
|
58
58
|
%i[geometry geography].include?(@sql_type_metadata.type)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
SPATIAL_ATTRIBUTES = %w[geographic geometric_type has_m has_z srid limit].freeze
|
|
62
|
+
|
|
63
|
+
def init_with(coder)
|
|
64
|
+
SPATIAL_ATTRIBUTES.each { |attr| instance_variable_set(:"@#{attr}", coder[attr]) }
|
|
65
|
+
super
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def encode_with(coder)
|
|
69
|
+
SPATIAL_ATTRIBUTES.each { |attr| coder[attr] = instance_variable_get(:"@#{attr}") }
|
|
70
|
+
super
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def ==(other)
|
|
74
|
+
other.is_a?(SpatialColumn) &&
|
|
75
|
+
super &&
|
|
76
|
+
SPATIAL_ATTRIBUTES.all? { |attr| public_send(attr) == other.public_send(attr) }
|
|
77
|
+
end
|
|
78
|
+
alias :eql? :==
|
|
79
|
+
|
|
80
|
+
def hash
|
|
81
|
+
SPATIAL_ATTRIBUTES.reduce(SpatialColumn.hash ^ super.hash) { |h, attr| h ^ public_send(attr).hash }
|
|
82
|
+
end
|
|
83
|
+
|
|
61
84
|
private
|
|
62
85
|
|
|
63
86
|
def set_geometric_type_from_name(name)
|
|
@@ -16,6 +16,7 @@ require_relative "postgis/spatial_column"
|
|
|
16
16
|
require_relative "postgis/arel_tosql"
|
|
17
17
|
require_relative "postgis/oid/spatial"
|
|
18
18
|
require_relative "postgis/oid/date_time"
|
|
19
|
+
require_relative "postgis/quoting"
|
|
19
20
|
require_relative "postgis/type" # has to be after oid/*
|
|
20
21
|
# :startdoc:
|
|
21
22
|
|
|
@@ -42,6 +43,7 @@ module ActiveRecord
|
|
|
42
43
|
# http://postgis.17.x6.nabble.com/Default-SRID-td5001115.html
|
|
43
44
|
DEFAULT_SRID = 0
|
|
44
45
|
|
|
46
|
+
include PostGIS::Quoting
|
|
45
47
|
include PostGIS::SchemaStatements
|
|
46
48
|
include PostGIS::DatabaseStatements
|
|
47
49
|
|
|
@@ -160,5 +162,4 @@ module ActiveRecord
|
|
|
160
162
|
spatial_ref_sys
|
|
161
163
|
topology
|
|
162
164
|
]
|
|
163
|
-
Tasks::DatabaseTasks.register_task(/postgis/, "ActiveRecord::Tasks::PostgreSQLDatabaseTasks")
|
|
164
165
|
end
|
|
@@ -4,3 +4,4 @@ require "active_record"
|
|
|
4
4
|
require "active_record/connection_adapters"
|
|
5
5
|
require "rgeo/active_record"
|
|
6
6
|
ActiveRecord::ConnectionAdapters.register("postgis", "ActiveRecord::ConnectionAdapters::PostGISAdapter", "active_record/connection_adapters/postgis_adapter")
|
|
7
|
+
ActiveRecord::Tasks::DatabaseTasks.register_task(/postgis/, "ActiveRecord::Tasks::PostgreSQLDatabaseTasks")
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-postgis-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 10.0.
|
|
4
|
+
version: 10.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Azuma
|
|
8
8
|
- Tee Parham
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2026-03-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activerecord
|
|
@@ -126,6 +126,7 @@ files:
|
|
|
126
126
|
- lib/active_record/connection_adapters/postgis/database_statements.rb
|
|
127
127
|
- lib/active_record/connection_adapters/postgis/oid/date_time.rb
|
|
128
128
|
- lib/active_record/connection_adapters/postgis/oid/spatial.rb
|
|
129
|
+
- lib/active_record/connection_adapters/postgis/quoting.rb
|
|
129
130
|
- lib/active_record/connection_adapters/postgis/schema_statements.rb
|
|
130
131
|
- lib/active_record/connection_adapters/postgis/spatial_column.rb
|
|
131
132
|
- lib/active_record/connection_adapters/postgis/spatial_column_info.rb
|
|
@@ -140,7 +141,7 @@ licenses:
|
|
|
140
141
|
metadata:
|
|
141
142
|
funding_uri: https://opencollective.com/rgeo
|
|
142
143
|
rubygems_mfa_required: 'true'
|
|
143
|
-
post_install_message:
|
|
144
|
+
post_install_message:
|
|
144
145
|
rdoc_options: []
|
|
145
146
|
require_paths:
|
|
146
147
|
- lib
|
|
@@ -155,8 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
155
156
|
- !ruby/object:Gem::Version
|
|
156
157
|
version: '0'
|
|
157
158
|
requirements: []
|
|
158
|
-
rubygems_version: 3.
|
|
159
|
-
signing_key:
|
|
159
|
+
rubygems_version: 3.5.22
|
|
160
|
+
signing_key:
|
|
160
161
|
specification_version: 4
|
|
161
162
|
summary: ActiveRecord adapter for PostGIS, based on RGeo.
|
|
162
163
|
test_files: []
|