spatial_features 2.4.0 → 2.4.1

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
  SHA1:
3
- metadata.gz: 5e0a3bff0a76b4cc7d6e569677d5ee9035f6da2b
4
- data.tar.gz: 225c280e58e6af0b5ce3623a582acd599037f9ef
3
+ metadata.gz: bb6bfa561f291c96ad983f88e7ce6f13a5961190
4
+ data.tar.gz: 4236d1b48756f5d8789b98afbfc1e47215b36423
5
5
  SHA512:
6
- metadata.gz: a35b743e5e5f90c58a002bafe5f823dbf90f1b25974f54809a2cbbf8a4a4aeabb59ca55f59677ead4f9a4e08977385ed50bdcaa811a6bc8f93cd5c094fe429f6
7
- data.tar.gz: 7eaab5ad9ea2087fd35962c518e3df8118911ae5450cd54a431314d1f90a159edb1813e866c5aa7dcc1d54805e1c7f04a4c0bcf7ddc5178a87b1c3f52d998943
6
+ metadata.gz: fb674ccbed4762a6c12196a9b5e8471b9469aed8e8012490a61d217d445ba70319bdbbe969412d4ab80f09279aaaa0e178eca29f660f4340f85270ca3e319875
7
+ data.tar.gz: 4a8d33366da54cc7754308634c87aee43fd3e0b72ba31659548b427f4f959179ca7f1f12bfe61ffd15795a45dfefcf305d272bb31339678b789f2c4dc06141f5
@@ -12,9 +12,9 @@ module SpatialFeatures
12
12
  end
13
13
 
14
14
  module ClassMethods
15
- def update_features!(skip_invalid: false)
15
+ def update_features!(skip_invalid: false, **options)
16
16
  find_each do |record|
17
- record.update_features!(skip_invalid: skip_invalid)
17
+ record.update_features!(skip_invalid: skip_invalid, **options)
18
18
  end
19
19
  end
20
20
  end
@@ -16,14 +16,19 @@ module SpatialFeatures
16
16
  object.class
17
17
  when ActiveRecord::Relation
18
18
  object.klass
19
+ when String
20
+ object.constantize
19
21
  else
20
22
  object
21
23
  end
22
24
  end
23
25
 
24
26
  def id_sql(object)
25
- if object.is_a?(ActiveRecord::Base)
27
+ case object
28
+ when ActiveRecord::Base
26
29
  object.id || '0'
30
+ when String
31
+ id_sql(object.constantize)
27
32
  else
28
33
  object.unscope(:select).select(:id).to_sql
29
34
  end
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace