Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions db/bootcamp_seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ def exercise_config_for(project_slug,

# Two pass - as the second needs all concepts created
Bootcamp::Concept.destroy_all
JSON.parse(File.read(Rails.root / "bootcamp_content/concepts/config.json"), symbolize_names: true).each do |details|
concepts_config = JSON.parse(File.read(Rails.root / "bootcamp_content/concepts/config.json"), symbolize_names: true)
concepts_config.each do |details|
Bootcamp::Concept.find_or_create_by!(slug: details[:slug]) do |c|
c.title = ""
c.description = ""
c.content_markdown = ""
c.level_idx = details[:level]
end
end
JSON.parse(File.read(Rails.root / "bootcamp_content/concepts/config.json"), symbolize_names: true).each do |details| # rubocop:disable Style/CombinableLoops
concepts_config.each do |details| # rubocop:disable Style/CombinableLoops
concept = Bootcamp::Concept.find_by!(slug: details[:slug])
concept.update!(
parent: details[:parent] ? Bootcamp::Concept.find_by!(slug: details[:parent]) : nil,
Expand Down Expand Up @@ -101,11 +102,6 @@ def exercise_config_for(project_slug,
e.level_idx = exercise_config[:level]
end

has_bonus_tasks = false
(exercise_config[:tasks] || []).each do |task|
has_bonus_tasks = true if task[:bonus]
end

exercise.update!(
idx: exercise_config[:idx],
title: exercise_config[:title],
Expand Down
Loading