[Racket] Ferti hydroponic nutrient solver, redux.
Add crop-id guard.
models/crop-requirement.rkt
@@ -28,9 +28,10 @@
28
28
"nutrient.rkt"
29
29
"crop.rkt")
30
30
31
Removed:
;; Instances of this struct are persisted in the crop_requirements table.
32
Removed:
(struct crop-requirement (id profile crop-id) #:transparent)
33
Removed:
31
Added:
(struct crop-requirement (id profile crop-id nutrient-values)
32
Added:
#:transparent
33
Added:
#:guard (λ (id profile crop-id nutrient-values _)
34
Added:
(values id profile (if (sql-null? crop-id) #f crop-id) nutrient-values)))
34
35
35
36
;; CREATE
36
37