Add description to sqm_category

This commit is contained in:
rebuilt 2021-10-05 17:14:13 +02:00
parent f8166aed47
commit 6a101eab76
4 changed files with 169 additions and 160 deletions

View file

@ -35,8 +35,11 @@ CSV.parse(measure_key_2021, headers: true).each do |row|
category_name = row['Category']
if SqmCategory.find_by_name(category_name).nil?
SqmCategory.create name: category_name
category = SqmCategory.find_or_create_by(name: category_name)
if category.description.nil?
category.description = row['Category Description']
category.save
end
subcategory_name = row['Subcategory']