Skip to content

Commit d3c7c83

Browse files
committed
Add create intake survey on survey_generator service
1 parent b8e9da8 commit d3c7c83

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/services/survey_generator.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ def self.generate_for_user(user)
1313

1414
survey
1515
end
16+
def self.create_intake_survey_for_user(user)
17+
survey = Survey.create!(user: user)
18+
# TODO: Will need to decide once we get 'finalized' questions which ones we want to be on the intake survey
19+
# For now, I'm just gonna grab all of them
20+
Question.each do |question|
21+
Answer.create!(question_id: question.id, survey: survey)
22+
end
23+
end
1624
end

0 commit comments

Comments
 (0)