Skip to content

Commit

Permalink
updated taxonomy to newest version
Browse files Browse the repository at this point in the history
  • Loading branch information
dereke committed Jan 13, 2020
1 parent f206cc8 commit 269ea4a
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 215 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# README

- `./nuke` - Nuke database
- `rake import:taxonomy` Populate initiatives
- `./run_tests` - Run tests
4 changes: 3 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'active_support/core_ext/string/inflections'

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
Expand Down Expand Up @@ -35,7 +37,7 @@

solutions = CSV.read('./import/taxonomy.csv', headers: true)
solutions.each do |line|
sector = Sector.find_or_create_by(name: line['sector'])
sector = Sector.find_or_create_by(name: line['sector'].titleize)
theme = Theme.find_or_create_by(name: line['theme'], sector: sector)
solution_class = SolutionClass.find_or_create_by(name: line['class'], theme: theme)
solution = Solution.find_or_create_by(name: line['solution'], created_by: admin, status: 200)
Expand Down
Loading

0 comments on commit 269ea4a

Please sign in to comment.