spatial_features 1.5.2 → 1.5.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: ed38fef2372d934ce3ac37ab4119209df532f5b4
4
- data.tar.gz: ae236c019c91fd2f10e4f9a385e4ca22794ceb46
3
+ metadata.gz: 9f5e50275e49d340e9b3b705079063a296475211
4
+ data.tar.gz: cdd28aa70864234435fdc1d676d26cec63763e03
5
5
  SHA512:
6
- metadata.gz: a095d1e3e5057f4ed07bfd8568a582ebe218975198b919380da6597be7f760137bc9331ec0c12bbcba56f9670a89ce20d37e8f35aa5b46a8818b37436c5ae1c7
7
- data.tar.gz: 05009d3f60028e36981df24276e1bf59708046a49dfe483533397b565eafd7aae95216c8a61157910978544606f3337b484a705d2120ea3d6d83804a0fcb1b06
6
+ metadata.gz: 20bf2f070aaa4858739d5ca51a65601f08b85c41221b710683a488f221ac76945444532f1d4867b6581b18b230578bd640cf56a75c1ab752a55d45524fbf5d7e
7
+ data.tar.gz: 462ec7481f45b62159eaaf63886f4f083a73dc5e8c9c5c7c823c1dd4951029ec7dee36710596ce765a56881fe0540d0c866e0d73ac17b4f2533a7886fbf20025
@@ -75,7 +75,11 @@ module SpatialFeatures
75
75
  end
76
76
 
77
77
  def features
78
- Feature.where(:spatial_model_type => self)
78
+ if self.respond_to?(:klass)
79
+ Feature.where(:spatial_model_type => self.klass, :spatial_model_id => all)
80
+ else
81
+ Feature.where(:spatial_model_type => self)
82
+ end
79
83
  end
80
84
 
81
85
  # Returns a scope that includes the features for this record as the table_alias and the features for other as #{table_alias}_other
@@ -215,7 +219,7 @@ module SpatialFeatures
215
219
 
216
220
  module FeaturesAssociationExtensions
217
221
  def area(options = {})
218
- if options[:cache] == false
222
+ if options[:cache] == false || !proxy_association.owner.class.has_features_area?
219
223
  connection.select_value(all.select('ST_Area(ST_UNION(geom))')).try(:to_f)
220
224
  else
221
225
  proxy_association.owner.features_area
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "1.5.2"
2
+ VERSION = "1.5.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: 1.5.2
4
+ version: 1.5.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: 2016-01-27 00:00:00.000000000 Z
12
+ date: 2016-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails