From 7b440dd89f43c62431f16b8f62233dd9d81bf98e Mon Sep 17 00:00:00 2001 From: Aphexis Date: Thu, 13 Feb 2020 21:17:56 -0500 Subject: [PATCH 1/2] add flowchart_node_id to seed data --- db/seeds.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index ead4dcc..c107cd9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -19,7 +19,8 @@ button_text: 'Button text 1', next_question: 'Next question 1', is_root: true, - flowchart_id: flowchart.id + flowchart_id: flowchart.id, + flowchart_node_id: nil ) node2 = FlowchartNode.create!( text: 'Node text 2', @@ -27,7 +28,8 @@ button_text: 'Button text 2', next_question: 'Next question 2', is_root: false, - flowchart_id: flowchart.id + flowchart_id: flowchart.id, + flowchart_node_id: 1 ) # set foreign keys From d4e18b8a68272c642f09de7c66cdf02140a22716 Mon Sep 17 00:00:00 2001 From: Aphexis Date: Thu, 13 Feb 2020 22:02:14 -0500 Subject: [PATCH 2/2] add node3, node4 to seed --- db/seeds.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/db/seeds.rb b/db/seeds.rb index c107cd9..bca47fa 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -31,6 +31,24 @@ flowchart_id: flowchart.id, flowchart_node_id: 1 ) + node3 = FlowchartNode.create!( + text: 'Node text 3', + header: 'Node header 3', + button_text: 'Button text 3', + next_question: 'Next question 3', + is_root: false, + flowchart_id: flowchart.id, + flowchart_node_id: 2 + ) + node4 = FlowchartNode.create!( + text: 'Node text 4', + header: 'Node header 4', + button_text: 'Button text 4', + next_question: 'Next question 4', + is_root: false, + flowchart_id: flowchart.id, + flowchart_node_id: 2 + ) # set foreign keys flowchart[:root_id] = node1.id