active_record_survey 0.1.15 → 0.1.16

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: b3a9dde97731e519a1757890a3fa2b8e9303321f
4
- data.tar.gz: 8b4b028274ac9119f30f7bad4d2a33c104931756
3
+ metadata.gz: 035843adb04a8500212d2192370393bfc3fc66aa
4
+ data.tar.gz: f8694ba634658681e9360c85dd49a4ad82718ced
5
5
  SHA512:
6
- metadata.gz: d3037fd5b559bc6aed2690fd0ee211f72c1b5e8a2d1fd607146905408af0dbfc9b748aea1f32b879ca25602bc8c184452bccb6255f446e24d0b9f5b43092c326
7
- data.tar.gz: efbb671a1431bb39af514019dbac3450cd19285f0139105b7a7770eea8069853bb1ad12489e2a143e975ec84fc7a78b1cafb92906f424e3bb813bcca781cab59
6
+ metadata.gz: 412ab7b79cd1a135626054fb2071eb20f710c1cda9761176271e0c6d030a3c408b03b9129a923e322d327eeb6b5670b9f6b18cd53931e02f18ab07c016a6e48c
7
+ data.tar.gz: deeb940e3e77c972ef800d4541a9f75781da2ae9b1b040237e9a774921eaa127ff44576346c7638882aa5b9c5d9771aaa438013b9afa1cd258265fcb5cf9aa20
data/README.md CHANGED
@@ -12,7 +12,7 @@ The goal is to give a simple interface for creating surveys and validating the a
12
12
  Release Notes
13
13
  ============
14
14
 
15
- **0.1.15*
15
+ **0.1.15**
16
16
  - Don't consider instance_nodes marked for destruction when validating
17
17
 
18
18
  **0.1.14**
@@ -9,6 +9,23 @@ module ActiveRecordSurvey
9
9
  }.include?(false)
10
10
  end
11
11
 
12
+ # Returns the question to the answer
13
+ def question
14
+ self.node_maps.collect { |node_map|
15
+ if node_map.parent && node_map.parent.node
16
+ # Question is not the next parent - recurse!
17
+ if node_map.parent.node.class.ancestors.include?(::ActiveRecordSurvey::Node::Answer)
18
+ node_map.parent.node.question
19
+ else
20
+ node_map.parent.node
21
+ end
22
+ # Root already
23
+ else
24
+ nil
25
+ end
26
+ }.first
27
+ end
28
+
12
29
  # Removes the link
13
30
  # TODO - does this work when saved??
14
31
  def remove_link
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordSurvey
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
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.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Butch Marshall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord