gotime-postgis_adapter 0.8.3 → 0.8.4
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.
- data/gotime-postgis_adapter-0.8.3.gem +0 -0
- data/lib/postgis_adapter.rb +0 -35
- data/postgis_adapter.gemspec +1 -1
- metadata +5 -4
Binary file
|
data/lib/postgis_adapter.rb
CHANGED
@@ -220,41 +220,6 @@ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
|
|
220
220
|
end
|
221
221
|
end
|
222
222
|
|
223
|
-
def indexes(table_name, name = nil) #:nodoc:
|
224
|
-
result = query(<<-SQL, name)
|
225
|
-
SELECT i.relname, d.indisunique, a.attname , am.amname
|
226
|
-
FROM pg_class t, pg_class i, pg_index d, pg_attribute a, pg_am am
|
227
|
-
WHERE i.relkind = 'i'
|
228
|
-
AND d.indexrelid = i.oid
|
229
|
-
AND d.indisprimary = 'f'
|
230
|
-
AND t.oid = d.indrelid
|
231
|
-
AND i.relam = am.oid
|
232
|
-
AND t.relname = '#{table_name}'
|
233
|
-
AND a.attrelid = t.oid
|
234
|
-
AND ( d.indkey[0]=a.attnum OR d.indkey[1]=a.attnum
|
235
|
-
OR d.indkey[2]=a.attnum OR d.indkey[3]=a.attnum
|
236
|
-
OR d.indkey[4]=a.attnum OR d.indkey[5]=a.attnum
|
237
|
-
OR d.indkey[6]=a.attnum OR d.indkey[7]=a.attnum
|
238
|
-
OR d.indkey[8]=a.attnum OR d.indkey[9]=a.attnum )
|
239
|
-
ORDER BY i.relname
|
240
|
-
SQL
|
241
|
-
|
242
|
-
current_index = nil
|
243
|
-
indexes = []
|
244
|
-
|
245
|
-
result.each do |row|
|
246
|
-
if current_index != row[0]
|
247
|
-
#index type gist indicates a spatial index (probably not totally true but let's simplify!)
|
248
|
-
indexes << ActiveRecord::ConnectionAdapters::IndexDefinition.
|
249
|
-
new(table_name, row[0], row[1] == "t", row[3] == "gist" ,[])
|
250
|
-
|
251
|
-
current_index = row[0]
|
252
|
-
end
|
253
|
-
indexes.last.columns << row[2]
|
254
|
-
end
|
255
|
-
indexes
|
256
|
-
end
|
257
|
-
|
258
223
|
def columns(table_name, name = nil) #:nodoc:
|
259
224
|
raw_geom_infos = column_spatial_info(table_name)
|
260
225
|
|
data/postgis_adapter.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gotime-postgis_adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-05 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nofxx-georuby
|
16
|
-
requirement: &
|
16
|
+
requirement: &2157443080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2157443080
|
25
25
|
description: Execute PostGIS functions on Active Record
|
26
26
|
email: x@nofxx.com
|
27
27
|
executables: []
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- Gemfile
|
33
33
|
- Gemfile.lock
|
34
34
|
- gotime-postgis_adapter-0.8.2.gem
|
35
|
+
- gotime-postgis_adapter-0.8.3.gem
|
35
36
|
- History.txt
|
36
37
|
- lib/postgis_adapter/acts_as_geom.rb
|
37
38
|
- lib/postgis_adapter/common_spatial_adapter.rb
|