diff options
author | Marius Peter <dev@marius-peter.com> | 2025-09-04 20:55:03 +0200 |
---|---|---|
committer | Marius Peter <dev@marius-peter.com> | 2025-09-04 20:55:03 +0200 |
commit | 8ba568ae0ebe715b5da453681eb141886f1977a8 (patch) | |
tree | 3bf3a3d5b41286d0a6da8895857314393bae1db2 /db/seeds/2_nutrient_measurements.rb | |
parent | 8f8cea2a0408918629dc8bab03495530861a71f3 (diff) |
Simpler, Better, Faster... Stronger
Start small, address critical customer needs, /then/ scale.
Diffstat (limited to 'db/seeds/2_nutrient_measurements.rb')
-rw-r--r-- | db/seeds/2_nutrient_measurements.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/db/seeds/2_nutrient_measurements.rb b/db/seeds/2_nutrient_measurements.rb deleted file mode 100644 index 0ca14f1..0000000 --- a/db/seeds/2_nutrient_measurements.rb +++ /dev/null @@ -1,27 +0,0 @@ -require "csv" - -csv_path = Rails.root.join("db", "data", "dolibarr_measurements.csv") -abort "CSV not found: #{csv_path}" unless File.exist?(csv_path) - -CSV.foreach(csv_path, headers: true) do |row| - NutrientMeasurement.find_or_create_by!(measured_on: Date.parse(row["date"])) do |m| - m.nno3 = row["nno3"] - m.p = row["p"] - m.k = row["k"] - m.ca = row["ca"] - m.mg = row["mg"] - m.s = row["s"] - m.na = row["na"] - m.cl = row["cl"] - m.si = row["si"] - m.fe = row["fe"] - m.zn = row["zn"] - m.b = row["b"] - m.mn = row["mn"] - m.cu = row["cu"] - m.mo = row["mo"] - m.nnh4 = row["nnh4"] - end -end - -puts "NutrientMeasurements: #{NutrientMeasurement.count}" |