spatial_features 2.6.2 → 2.6.3

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: e0d6a938f938beece059dc842bd0312d3c237ade
4
- data.tar.gz: aa45a80c13cb9ccc478a447b44f57e347dbbea1a
3
+ metadata.gz: 8920e2ab520f59f4dc451b6f37df68fe53a7d5de
4
+ data.tar.gz: 81ea657e62042570045d3fb7ffb5cd8a3738d387
5
5
  SHA512:
6
- metadata.gz: ddfe367936f321a4594e164efa2e0501f0773832b8e3a84ff5f0d0980d4f23ef9c3d40a2e497de20d8bbdcd3ca66d34292c523bfaa0a8335f8df13a3127762aa
7
- data.tar.gz: 802c1fb0f7ae514a2c3d22009d620b6d12789e2e848c59fc8e41a2d2882e3838656fb8581f275e896ec6203a0eb8753b106277977d5a506e79aa5b1d40ea5d0a
6
+ metadata.gz: c6d4187a0dbf6dd5974f770a7397c8ad8ddf354342f97da2ed10f84d19120fa9dd51437371e13fa98f796e86f3c92f1beda74c38dfc724b4e59419106c8d3c2c
7
+ data.tar.gz: 79023ebeea75cc8527992bb0f562349bc5b54569c08d8068e6d7dd8006381f80baf8f7a5182db8520abda42e6f86c846dcc16d7d11530f8cf14b605ec0541cba
@@ -12,6 +12,10 @@ class Feature < ActiveRecord::Base
12
12
  before_save :sanitize
13
13
  after_save :cache_derivatives
14
14
 
15
+ def self.cache_key
16
+ "maximum(:id)}-#{count}"
17
+ end
18
+
15
19
  def self.with_metadata(k, v)
16
20
  if k.present? && v.present?
17
21
  where('metadata->? = ?', k, v)
@@ -40,7 +40,7 @@ module SpatialFeatures
40
40
  # tell if they have changed by finding the maximum id and count instead of needing timestamps
41
41
  def features_cache_key
42
42
  # Do two separate queries because it is much faster for some reason
43
- "#{name}/#{features.maximum(:id)}-#{features.count}"
43
+ "#{name}/#{features.cache_key}"
44
44
  end
45
45
 
46
46
  def intersecting(other, options = {})
@@ -165,8 +165,7 @@ module SpatialFeatures
165
165
  end
166
166
 
167
167
  def features_cache_key
168
- max_id, count = features.pluck("MAX(id), COUNT(*)").first
169
- "#{self.class.name}/#{self.id}-#{max_id}-#{count}"
168
+ "#{self.class.name}/#{self.id}-#{features.cache_key}"
170
169
  end
171
170
 
172
171
  def polygons?
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.6.2"
2
+ VERSION = "2.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spatial_features
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-02 00:00:00.000000000 Z
12
+ date: 2019-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails