active_record_survey 0.1.38 → 0.1.39

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: 241fd16207e3dbcd096b90623040aa4142152663
4
- data.tar.gz: 6ccfd912a9438462a86152a38e4b783c3088d85d
3
+ metadata.gz: 60c9449620b59d5e5fead5ab4a0d168a20f09695
4
+ data.tar.gz: 477a7031adf2e0efe973606157f39bcec522b2bd
5
5
  SHA512:
6
- metadata.gz: e30a4dda78ec1c903d70100db1a83dc6fdbbf0a93d213b329a389a02f5beadad0cefdcff43e02d1b790ce053e924345beabd502da3c89bd54369a36a7a6efb1c
7
- data.tar.gz: a80ed53f9f0261fe74ef34537b28451d3291fd9d72ff5cf04a26b72a26cd2a3ee9bdccb3c399970e21f5570bb95f67acd00937c3661fcd42a2bed2ef642ccf76
6
+ metadata.gz: 36524e334c8ea4e54c402d2f1c2210a558b36dd6fbaf800ba509f9b7040ee3bf2a14620e20a7206c5fec546aa34c166de5b8e248fe971660c4900132acfda450
7
+ data.tar.gz: 625e0143247e13506f40b40f096ea0f5627f41671ad84793c736ed49bba4854c31b4d3fb5cba1ab13770a9dc26f5d0fe1baf39f7e0aa78a17535346acaf28137
@@ -37,6 +37,21 @@ module ActiveRecordSurvey
37
37
  result
38
38
  end
39
39
 
40
+ # Whether decendant of a particular node_map
41
+ def is_decendant_of?(node_map)
42
+ # Hit ourselves
43
+ if node_map == self
44
+ return true
45
+ end
46
+
47
+ # Recurse
48
+ if self.parent
49
+ return self.parent.is_decendant_of?(node_map)
50
+ end
51
+
52
+ false
53
+ end
54
+
40
55
  # Gets all the ancestor nodes until one is not an ancestor of klass
41
56
  def ancestors_until_node_not_ancestor_of(klass)
42
57
  if !self.parent || !self.node.class.ancestors.include?(klass)
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordSurvey
2
- VERSION = "0.1.38"
2
+ VERSION = "0.1.39"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_survey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.38
4
+ version: 0.1.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Butch Marshall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-02 00:00:00.000000000 Z
11
+ date: 2016-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord