rgeo-activerecord 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.4.3 / 2012-02-22
2
+
3
+ * Some fixes for Rails 3.2 compatibility.
4
+
1
5
  === 0.4.2 / 2012-01-09
2
6
 
3
7
  * Added an "rgeo-activerecord.rb" wrapper so bundler's auto-require will work without modification. (Reported by Mauricio Pasquier Juan.)
data/README.rdoc CHANGED
@@ -22,9 +22,9 @@ spatial \ActiveRecord adapters based on \RGeo.
22
22
  RGeo::ActiveRecord has the following requirements:
23
23
 
24
24
  * Ruby 1.8.7 or later. Ruby 1.9.2 or later preferred.
25
- * rgeo 0.3.3 or later.
25
+ * rgeo 0.3.4 or later.
26
26
  * activerecord 3.0.3 or later. Earlier versions will not work.
27
- Should be compatible with Rails 3.1.
27
+ Should be compatible with Rails versions through 3.2.x.
28
28
  * arel 2.0.6 or later. Earlier versions will not work.
29
29
 
30
30
  Generally, \ActiveRecord adapters which depend on this module should be
@@ -66,7 +66,7 @@ Contact the author at dazuma at gmail dot com.
66
66
 
67
67
  \RGeo is written by Daniel Azuma (http://www.daniel-azuma.com).
68
68
 
69
- Development of \RGeo is sponsored by GeoPage, Inc. (http://www.geopage.com).
69
+ Development is supported by Pirq. (http://www.pirq.com).
70
70
 
71
71
  === License
72
72
 
data/Version CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -95,7 +95,7 @@ module RGeo
95
95
  self.const_set("Klass#{@class_num}".to_sym, klass_)
96
96
  klass_.class_eval do
97
97
  establish_connection(config_) if config_
98
- set_table_name(:spatial_test)
98
+ self.table_name = :spatial_test
99
99
  end
100
100
  klass_
101
101
  end
@@ -131,13 +131,24 @@ module RGeo
131
131
  end
132
132
  # Clear any RGeo factory settings.
133
133
  klass_.connection_pool.rgeo_factory_settings.clear!
134
- # Rails 3.1 does more aggressive caching than 3.0 did; need to
135
- # clear those because the next test might assume different data.
134
+ # Clear out any ActiveRecord caches that are present.
135
+ # Different 3.x versions use different types of caches.
136
136
  if klass_.connection_pool.respond_to?(:clear_cache!)
137
- klass_.connection_pool.clear_cache!
138
- klass_.connection.clear_query_cache
137
+ if klass_.connection.respond_to?(:schema_cache)
138
+ # 3.2.x
139
+ klass_.connection_pool.with_connection do |c_|
140
+ c_.schema_cache.clear!
141
+ end
142
+ else
143
+ # 3.1.x
144
+ klass_.connection_pool.clear_cache!
145
+ end
146
+ end
147
+ if klass_.connection.respond_to?(:clear_cache!)
148
+ # 3.1 and above
139
149
  klass_.connection.clear_cache!
140
150
  end
151
+ klass_.connection.clear_query_cache
141
152
  end
142
153
 
143
154
 
@@ -130,7 +130,11 @@ module RGeo
130
130
  # class's connection.
131
131
 
132
132
  def rgeo_factory_settings
133
- pool_ = connection_pool
133
+ pool_ = begin
134
+ connection_pool
135
+ rescue ::ActiveRecord::ConnectionNotEstablished
136
+ nil
137
+ end
134
138
  pool_ ? pool_.rgeo_factory_settings : RGeoFactorySettings::DEFAULT
135
139
  end
136
140
 
@@ -34,6 +34,7 @@
34
34
  ;
35
35
 
36
36
 
37
+ require 'active_support/core_ext/class' # Workaround for a missing require in ActiveRecord 3.2.1
37
38
  require 'active_record'
38
39
 
39
40
  ::ActiveRecord::ConnectionAdapters::AbstractAdapter
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeo-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-10 00:00:00.000000000 Z
12
+ date: 2012-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rgeo
16
- requirement: &2164456360 !ruby/object:Gem::Requirement
16
+ requirement: &2152768380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.3.3
21
+ version: 0.3.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2164456360
24
+ version_requirements: *2152768380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activerecord
27
- requirement: &2164455600 !ruby/object:Gem::Requirement
27
+ requirement: &2152694520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2164455600
35
+ version_requirements: *2152694520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: arel
38
- requirement: &2164455040 !ruby/object:Gem::Requirement
38
+ requirement: &2152673420 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 2.0.6
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2164455040
46
+ version_requirements: *2152673420
47
47
  description: RGeo is a geospatial data library for Ruby. RGeo::ActiveRecord is an
48
48
  optional RGeo module providing some spatial extensions to ActiveRecord, as well
49
49
  as common tools used by RGeo-based spatial adapters.
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: 1.3.1
89
89
  requirements: []
90
90
  rubyforge_project: virtuoso
91
- rubygems_version: 1.8.12
91
+ rubygems_version: 1.8.17
92
92
  signing_key:
93
93
  specification_version: 3
94
94
  summary: An RGeo module providing spatial extensions to ActiveRecord.