active_record_survey 0.1.42 → 0.1.43

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: dbe716976900fa899ddff1304f5f0af1add82160
4
- data.tar.gz: 9784ddb5461e775944ab103605ff4bdf5b72acfa
3
+ metadata.gz: 5dc949333e22faad454c71dbdc2cd63088cd71cf
4
+ data.tar.gz: d341536053150cdfcca45862094780537de92539
5
5
  SHA512:
6
- metadata.gz: cb1f07e7e049696ffbe105476b15ce24e22f3479ebc587c342e506fc7ee68ee01a99f14a99949911f33ed80f826d34428af27e2af2ca8af3a7cb405e19a716ff
7
- data.tar.gz: 38ff22b1e31e62a23870e35db8be76a0ca2439ff4c183bdf82752f64b0cd65a647484e91d346e89d0b7249292c24469520bfc9267277b80778ba0e11368f4695
6
+ metadata.gz: 6ebc9abf180663238c747ba7173754435148a1b9bf99c996825dd864bed8f25f0cbc96b14ad987ecc65ecf4d382cab28c60a7071056472c13240e8ced7709581
7
+ data.tar.gz: 0b85ef3c7fef633bcfc843a3782114fd5dac5884b48993c0a936d35737f4c873e0e989bdd696532653533127574846e49b647ff542d3e73b4ec6bdefe734acb3
@@ -2,7 +2,7 @@ module ActiveRecordSurvey
2
2
  class Survey < ::ActiveRecord::Base
3
3
  self.table_name = "active_record_surveys"
4
4
  has_many :node_maps, :class_name => "ActiveRecordSurvey::NodeMap", :foreign_key => :active_record_survey_id, autosave: true
5
- has_many :nodes, -> { distinct }, :through => :node_maps
5
+ has_many :nodes, :class_name => "ActiveRecordSurvey::Node", :foreign_key => :active_record_survey_id
6
6
  has_many :questions, :class_name => "ActiveRecordSurvey::Node::Question", :foreign_key => :active_record_survey_id
7
7
 
8
8
  def root_node
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordSurvey
2
- VERSION = "0.1.42"
2
+ VERSION = "0.1.43"
3
3
  end
@@ -47,12 +47,15 @@ describe ActiveRecordSurvey::Survey, :survey_spec => true do
47
47
  @survey.save
48
48
  end
49
49
 
50
- describe '#edges', :focus => true do
50
+ describe '#edges' do
51
51
  it 'should return an array of all the connective edges' do
52
- edges = @survey.edges
52
+ expect(@survey.edges.length).to eq(16)
53
+ end
54
+ end
53
55
 
54
- expect(edges.length).to eq(16)
55
- expect(edges).to eq([{:source=>1, :target=>2}, {:source=>1, :target=>12}, {:source=>1, :target=>13}, {:source=>2, :target=>3}, {:source=>3, :target=>4}, {:source=>3, :target=>8}, {:source=>12, :target=>9}, {:source=>9, :target=>10}, {:source=>9, :target=>11}, {:source=>13, :target=>5}, {:source=>5, :target=>6}, {:source=>5, :target=>7}, {:source=>4, :target=>5}, {:source=>8, :target=>9}, {:source=>10, :target=>5}, {:source=>11, :target=>5}])
56
+ describe '#nodes', :focus => true do
57
+ it 'should return an array of all the nodes' do
58
+ expect(@survey.nodes.length).to eq(13)
56
59
  end
57
60
  end
58
61
 
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.42
4
+ version: 0.1.43
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-11-20 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord