postgres_ext-postgis 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cac0a121247af03c4780517dede0b21df7dc69be
4
- data.tar.gz: af8fe65cdd16c85c0406143ae9114a311fd2c578
3
+ metadata.gz: 0249f0e74ab37125453139a6dfbacaacfc41949d
4
+ data.tar.gz: 2590696b3a4a761ce7ddce79ee37a9eb0d5cde2f
5
5
  SHA512:
6
- metadata.gz: bb6ec89eaf2a20b87e3dc77504cd51bbad1c7e7af2dfcd48c1e7ac27970f4453b5d62dc523656051826d8a1749fdd13b531abb9e78b110e34e86b8e520580cf6
7
- data.tar.gz: 9380cb66cf6a2a3aad3a3c2043b51d4908384bbfdc00ceea12e5806eb1433f245095bb7da678127ca40bbd836a107ff12b1144a134980a3a5e89f1a0bb0a290e
6
+ metadata.gz: d09d2c4474a3ef99b59168258a3e032ff913d6fa391c992540b680c206127ae613d171ba8ec824fc3d04447026388be5064c7fe2ae33a769477ddc27094772c2
7
+ data.tar.gz: a1297753c17dc788e4085cffd815bf45bf3852051572441ef6dd794647044bc5b762a97938b686f61911dd2ca42348d9cf8a1ae8fba4d8271bb8d52b92d8b121
@@ -53,6 +53,15 @@ module PostgresExt::Postgis::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
53
53
 
54
54
  self
55
55
  end
56
+
57
+ def new_column_definition(name, type, options)
58
+ column = super
59
+
60
+ column.srid = options[:srid]
61
+ column.spatial_type = options[:spatial_type]
62
+
63
+ column
64
+ end
56
65
  end
57
66
 
58
67
  module Quoting
@@ -1,5 +1,5 @@
1
1
  module PostgresExt
2
2
  module Postgis
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
@@ -30,4 +30,28 @@ describe 'Geometry Migrations' do
30
30
  geo_1.sql_type.must_equal 'geometry(LineString,4326)'
31
31
  geo_2.sql_type.must_equal 'geometry(LineString,4326)'
32
32
  end
33
+
34
+ it 'adds geometry columns with type and SRID' do
35
+ connection.create_table :data_types do |t|
36
+ end
37
+
38
+ connection.add_column :data_types, :geo_1, :geometry
39
+
40
+ columns = connection.columns(:data_types)
41
+ geo_1 = columns.find { |c| c.name == 'geo_1' }
42
+
43
+ geo_1.sql_type.must_equal 'geometry'
44
+ end
45
+
46
+ it 'adds geometry columns with type and SRID' do
47
+ connection.create_table :data_types do |t|
48
+ end
49
+
50
+ connection.add_column :data_types, :geo_1, :geometry, spatial_type: :linestring, srid: 4326
51
+
52
+ columns = connection.columns(:data_types)
53
+ geo_1 = columns.find { |c| c.name == 'geo_1' }
54
+
55
+ geo_1.sql_type.must_equal 'geometry(LineString,4326)'
56
+ end
33
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgres_ext-postgis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan McClain