spatial_features 2.5.1 → 2.5.2

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: c21a50dd4e235bfc2f855c476f8644db26bf75ca
4
- data.tar.gz: 53d679df34b9a530c923de534e1fece3b8f839a4
3
+ metadata.gz: 6546da69d43dd7c33cc9b19158b3d3c9f470a408
4
+ data.tar.gz: 6d4c6fed9cf11d5e9ab969731f191da542b684b0
5
5
  SHA512:
6
- metadata.gz: b094cfe9ba427e4c8eb38367b3b314f2f3713fd270baf83e2f4e0c21ba91c090892a5faf039f60866a43ceb09913c53ea68f1a405607f12484ebbb915fa90ef5
7
- data.tar.gz: d969f8754ebb96c78aa7ebae18f49c6f671ef48e1aa21bec78aaf80eb22a87143c52df3adce2dbbe1afda3b301fb473b8c7a5d14baed12e6086d212f2af95b70
6
+ metadata.gz: 0ded67ca6baf54207080e00c3c14887952a285d31b5a7c28af1a9c552be0a6706833ac809aa2719d76d276313eb70c9ff2a1fb0f95ce964110b65b85a95d4f69
7
+ data.tar.gz: 17edbcf806c5acdff92150dd1990f6c37b0ba1705050c55721d29dda7fb1d58edcbf70b7a71a8ba02288f8604018dc390ef8c29b63265c551a7d1f601ce11922
@@ -1,3 +1,4 @@
1
+ # TODO: Test the `::features` on a subclass to ensure we scope correctly
1
2
  module SpatialFeatures
2
3
  module ActMethod
3
4
  def has_spatial_features(options = {})
@@ -71,10 +72,11 @@ module SpatialFeatures
71
72
  end
72
73
 
73
74
  def features
75
+ type = base_class # Rails stores polymorphic foreign keys as the base class
74
76
  if all == unscoped
75
- Feature.where(:spatial_model_type => self)
77
+ Feature.where(:spatial_model_type => type)
76
78
  else
77
- Feature.where(:spatial_model_type => self, :spatial_model_id => all.unscope(:select))
79
+ Feature.where(:spatial_model_type => type, :spatial_model_id => all.unscope(:select))
78
80
  end
79
81
  end
80
82
 
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.5.1"
2
+ VERSION = "2.5.2"
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.5.1
4
+ version: 2.5.2
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: 2017-10-11 00:00:00.000000000 Z
12
+ date: 2018-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails