activerecord-postgis-adapter 3.0.0.beta3 → 3.0.0.beta4
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_adapter/arel_tosql.rb +2 -3
- data/lib/active_record/connection_adapters/postgis_adapter/main_adapter.rb +3 -3
- data/lib/active_record/connection_adapters/postgis_adapter/version.rb +1 -1
- data/lib/active_record/connection_adapters/postgis_adapter.rb +2 -9
- metadata +1 -3
- data/test/postgres_test.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c4921aa89cd6c33269ff6f2850140020602440b
|
4
|
+
data.tar.gz: 6a32214e6ccc587ee9ca8c7bdcf29290725d9143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b7f244e186d445554d57be503cd02d6f9cc3f6ead1d3d0f2db5bba7300f9b3a34b0f4f12184984fa7bbf4a3048a4114e6a80be148f2d871cdf1ed59fd286e8
|
7
|
+
data.tar.gz: aac5a7ac04094aca372a331f1c560f9a208c35a119d520d02cebb7258675a7615c7dd262079ed765f15b2e375b5156d1cbd4152a8532f97ca3d081193d608171
|
@@ -8,13 +8,12 @@ module Arel # :nodoc:
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class PostGIS < PostGISSuperclass # :nodoc:
|
11
|
+
include RGeo::ActiveRecord::SpatialToSql
|
11
12
|
|
12
13
|
FUNC_MAP = {
|
13
14
|
'st_wkttosql' => 'ST_GeomFromEWKT',
|
14
15
|
}
|
15
|
-
|
16
|
-
include RGeo::ActiveRecord::SpatialToSql
|
17
|
-
|
16
|
+
|
18
17
|
def st_func(standard_name)
|
19
18
|
FUNC_MAP[standard_name.downcase] || standard_name
|
20
19
|
end
|
@@ -2,6 +2,8 @@ module ActiveRecord # :nodoc:
|
|
2
2
|
module ConnectionAdapters # :nodoc:
|
3
3
|
module PostGISAdapter # :nodoc:
|
4
4
|
class MainAdapter < PostgreSQLAdapter # :nodoc:
|
5
|
+
include PostGISAdapter::SchemaStatements
|
6
|
+
|
5
7
|
SPATIAL_COLUMN_OPTIONS =
|
6
8
|
{
|
7
9
|
geography: { geographic: true },
|
@@ -24,8 +26,6 @@ module ActiveRecord # :nodoc:
|
|
24
26
|
@visitor = Arel::Visitors::PostGIS.new(self)
|
25
27
|
end
|
26
28
|
|
27
|
-
include PostGISAdapter::SchemaStatements
|
28
|
-
|
29
29
|
# def schema_creation
|
30
30
|
# PostGISAdapter::SchemaCreation.new self
|
31
31
|
# end
|
@@ -35,7 +35,7 @@ module ActiveRecord # :nodoc:
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def adapter_name
|
38
|
-
|
38
|
+
"PostGIS".freeze
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.spatial_column_options(key)
|
@@ -1,18 +1,10 @@
|
|
1
1
|
# The activerecord-postgis-adapter gem installs the *postgis*
|
2
2
|
# connection adapter into ActiveRecord.
|
3
3
|
|
4
|
-
module ActiveRecord
|
5
|
-
module ConnectionAdapters
|
6
|
-
module PostGISAdapter
|
7
|
-
# The name returned by #adapter_name
|
8
|
-
ADAPTER_NAME = 'PostGIS'.freeze
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
4
|
# :stopdoc:
|
14
5
|
|
15
6
|
require 'active_record/connection_adapters/postgresql_adapter'
|
7
|
+
require 'rgeo/active_record'
|
16
8
|
require 'active_record/connection_adapters/postgis_adapter/version'
|
17
9
|
require 'active_record/connection_adapters/postgis_adapter/schema_statements'
|
18
10
|
require 'active_record/connection_adapters/postgis_adapter/main_adapter'
|
@@ -25,6 +17,7 @@ require 'active_record/connection_adapters/postgis_adapter/oid/spatial'
|
|
25
17
|
require 'active_record/connection_adapters/postgis_adapter/create_connection'
|
26
18
|
require 'active_record/connection_adapters/postgis_adapter/postgis_database_tasks'
|
27
19
|
|
20
|
+
|
28
21
|
::ActiveRecord::ConnectionAdapters::PostGISAdapter.initial_setup
|
29
22
|
|
30
23
|
if defined?(::Rails::Railtie)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgis-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma, Tee Parham
|
@@ -123,7 +123,6 @@ files:
|
|
123
123
|
- test/database.yml
|
124
124
|
- test/ddl_test.rb
|
125
125
|
- test/nested_class_test.rb
|
126
|
-
- test/postgres_test.rb
|
127
126
|
- test/setup_test.rb
|
128
127
|
- test/spatial_queries_test.rb
|
129
128
|
- test/tasks_test.rb
|
@@ -158,7 +157,6 @@ test_files:
|
|
158
157
|
- test/database.yml
|
159
158
|
- test/ddl_test.rb
|
160
159
|
- test/nested_class_test.rb
|
161
|
-
- test/postgres_test.rb
|
162
160
|
- test/setup_test.rb
|
163
161
|
- test/spatial_queries_test.rb
|
164
162
|
- test/tasks_test.rb
|
data/test/postgres_test.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PostgresTest < ActiveSupport::TestCase # :nodoc:
|
4
|
-
|
5
|
-
PLAIN_CONFIG = { adapter: "postgresql", host: "localhost", database: "apa_pg_test" }
|
6
|
-
|
7
|
-
class Dog < ActiveRecord::Base
|
8
|
-
establish_connection PLAIN_CONFIG
|
9
|
-
end
|
10
|
-
|
11
|
-
# unless Dog.connection.tables.include?('dogs')
|
12
|
-
# ActiveRecord::Schema.define do
|
13
|
-
# create_table :dogs do |table|
|
14
|
-
# table.column :name, :string
|
15
|
-
# end
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
#
|
19
|
-
# test "postgres model" do
|
20
|
-
# assert Dog.count == 0
|
21
|
-
# end
|
22
|
-
|
23
|
-
|
24
|
-
end
|