summaryrefslogtreecommitdiff
path: root/db/seeds/1_nutrients.rb
blob: dab22496a7fe953f3370188786840b070975fe67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
NUTRIENTS = [
  [ "nno3", "nitrate" ],
  [ "p",    "phosphore" ],
  [ "k",    "potassium" ],
  [ "ca",   "calcium" ],
  [ "mg",   "magnésium" ],
  [ "s",    "soufre" ],
  [ "na",   "sodium" ],
  [ "cl",   "chlore" ],
  [ "si",   "silice" ],
  [ "fe",   "fer" ],
  [ "zn",   "zinc" ],
  [ "b",    "bore" ],
  [ "mn",   "manganèse" ],
  [ "cu",   "cuivre" ],
  [ "mo",   "molybdène" ],
  [ "nnh4", "ammonium" ]
]

NUTRIENTS.each do |formula, name|
  Nutrient.find_or_create_by!(formula:) { |n| n.name = name }
end

puts "Nutrients: #{Nutrient.count}"
Copyright 2019--2025 Marius PETER