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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70d220862e9555c61d021f6ba1b1c6b38b66697150409c3412a660e243e0e571
4
- data.tar.gz: f4cfa91b9559063e44c085105ae8d578882a12ab3db8bcdcc21337d0e03fa508
3
+ metadata.gz: 006fc33b47e59f9a1a422164e55ce515434cc0b73aa0ebbb6b001f42fcc9bed3
4
+ data.tar.gz: 2f83c9c9f633b1b7a1a82e9357637a310a893cf8d2c3c72b5b51bef1ef5c1e9c
5
5
  SHA512:
6
- metadata.gz: f742dd692b5799806f7fa4e39f94aadecae296ae894b8f8c1bba5a8b54cda1ba339afc49961d7b3562d697ad3d0bb024674eff21a385d514c3fcf4204bb5bfe0
7
- data.tar.gz: 2f72d8a3975d7cb776ecfcfc51b4e28d2197cd6ae80de88ec345705aeab78995db29bdff52f161bcfd3efab15764ac940df7a5ec387b0fcb376634bf700c01db
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)
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module ConnectionAdapters
5
5
  module PostGIS
6
- VERSION = "10.0.0"
6
+ VERSION = "10.0.2"
7
7
  end
8
8
  end
9
9
  end
@@ -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.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: 2024-11-04 00:00:00.000000000 Z
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.3.26
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: []