rgeo-activerecord 0.5.0.beta1 → 0.5.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
data/Version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.0.
|
1
|
+
0.5.0.beta2
|
@@ -144,25 +144,30 @@ module RGeo
|
|
144
144
|
|
145
145
|
def cleanup_caches
|
146
146
|
klass_ = self.class.const_get(:DEFAULT_AR_CLASS)
|
147
|
+
|
147
148
|
# Clear any RGeo factory settings.
|
148
149
|
klass_.connection_pool.rgeo_factory_settings.clear!
|
150
|
+
|
149
151
|
# Clear out any ActiveRecord caches that are present.
|
150
152
|
# Different Rails versions use different types of caches.
|
153
|
+
has_schema_cache_ = false
|
151
154
|
klass_.connection_pool.with_connection do |c_|
|
152
155
|
if c_.respond_to?(:schema_cache)
|
153
156
|
# 3.2.x and 4.0.x
|
154
157
|
c_.schema_cache.clear!
|
158
|
+
has_schema_cache_ = true
|
155
159
|
end
|
160
|
+
if c_.respond_to?(:clear_cache!)
|
161
|
+
# 3.1 and above
|
162
|
+
c_.clear_cache!
|
163
|
+
end
|
164
|
+
# All 3.x and 4.0
|
165
|
+
c_.clear_query_cache
|
156
166
|
end
|
157
|
-
if klass_.connection_pool.respond_to?(:clear_cache!)
|
158
|
-
# 3.1.x
|
167
|
+
if !has_schema_cache_ && klass_.connection_pool.respond_to?(:clear_cache!)
|
168
|
+
# 3.1.x only
|
159
169
|
klass_.connection_pool.clear_cache!
|
160
170
|
end
|
161
|
-
if klass_.connection.respond_to?(:clear_cache!)
|
162
|
-
# 3.1 and above
|
163
|
-
klass_.connection.clear_cache!
|
164
|
-
end
|
165
|
-
klass_.connection.clear_query_cache
|
166
171
|
end
|
167
172
|
|
168
173
|
|
@@ -65,8 +65,7 @@ module RGeo
|
|
65
65
|
|
66
66
|
# Index definition struct with a spatial flag field.
|
67
67
|
|
68
|
-
class SpatialIndexDefinition <
|
69
|
-
attr_accessor :spatial
|
68
|
+
class SpatialIndexDefinition < Struct.new(:table, :name, :unique, :columns, :lengths, :orders, :where, :spatial)
|
70
69
|
end
|
71
70
|
|
72
71
|
|