spatial_features 2.9.2 → 2.9.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3e2c6c37c86184dd032197290dc4916da76c917b7aa9e3c32a137488d177205
4
- data.tar.gz: ce13b12e24115cf40ff5c4ed000fb6aa2cd93612deef554b3e6de1ff7216f189
3
+ metadata.gz: 060dca976eac8a7cbff438221861b8b60cf559d5c8edae033bf1cd35f1b1ed84
4
+ data.tar.gz: ca965a8dbaa21d63f4c226517a7229d573ceec923e97a03b0906da028605b4c0
5
5
  SHA512:
6
- metadata.gz: 1a1b2b1a7688bb316bccaac6998e6f7e0d52bfd6d51ab2665faee87ea199e83a499fcf6b5e4dfcea3fe64bc232d6bba3e9db11c07f178b0a64ff2c9a7be005d8
7
- data.tar.gz: 5a092ae13944641bc21c1249c5826e0c1837a72ffd528ac4b31f905e169298c798bb954ac19a75c7e5afe928f49730eac75db31d7fa149ebd3e458b8b377616d
6
+ metadata.gz: 2deace5489bb06708d816d16673bd23b2259b604bc592f7c33e6e29eb1055a1ba6992e11312148f76bb885d20c449a35a8ee0be5c0ff9d3725d0d68ebecec633
7
+ data.tar.gz: 1738c4c0665b974aff7ebbf3774d031e444d64a2362f32ede6baae7ca8e7afef47a2c247b8dabf82e1adfabce975138e06bb4e52156344030526c30246180335
@@ -14,7 +14,7 @@ class AbstractFeature < ActiveRecord::Base
14
14
  validates_presence_of :geog
15
15
  validate :validate_geometry
16
16
  before_save :sanitize
17
- after_save :cache_derivatives
17
+ after_save :cache_derivatives, :if => :saved_change_to_geog?
18
18
 
19
19
  def self.cache_key
20
20
  "#{maximum(:id)}-#{count}"
@@ -189,4 +189,12 @@ class AbstractFeature < ActiveRecord::Base
189
189
  def sanitize_input_for_sql(input)
190
190
  self.class.send(:sanitize_sql_for_conditions, input)
191
191
  end
192
+
193
+ def saved_change_to_geog?
194
+ if Rails.version >= '5.1'
195
+ super
196
+ else
197
+ geog_changed?
198
+ end
199
+ end
192
200
  end
@@ -47,7 +47,7 @@ class Feature < AbstractFeature
47
47
  # Check if there is a spatial model id because nothing prevents is from creating a Feature without one. Depending on
48
48
  # how you assign a feature to a record, you may end up saving it before assigning it to a record, thereby leaving
49
49
  # this field blank.
50
- spatial_model_id? && automatically_refresh_aggregate
50
+ spatial_model_id? && automatically_refresh_aggregate && saved_change_to_geog?
51
51
  end
52
52
 
53
53
  # Features are used for display so we also cache their KML representation
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.9.2"
2
+ VERSION = "2.9.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.9.2
4
+ version: 2.9.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: 2019-12-30 00:00:00.000000000 Z
12
+ date: 2020-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -220,7 +220,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  requirements: []
223
- rubygems_version: 3.0.3
223
+ rubyforge_project:
224
+ rubygems_version: 2.7.9
224
225
  signing_key:
225
226
  specification_version: 4
226
227
  summary: Adds spatial methods to a model.