diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-08-24 20:29:54 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-08-24 20:29:54 +0200 |
commit | 52b044d6a4278c229992404ad5801769c2d13363 (patch) | |
tree | b30b34da58f26117c035391d09366b190350b1e3 /db/seeds/1_nutrients.rb |
First commit.
Vive le Castel Peter !
Diffstat (limited to 'db/seeds/1_nutrients.rb')
-rw-r--r-- | db/seeds/1_nutrients.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/db/seeds/1_nutrients.rb b/db/seeds/1_nutrients.rb new file mode 100644 index 0000000..dab2249 --- /dev/null +++ b/db/seeds/1_nutrients.rb @@ -0,0 +1,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}" |