diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-11-30 13:53:46 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-11-30 13:53:46 +0100 |
| commit | 0e0de4a45c10fb2f1ea628f2514cf3f2742db310 (patch) | |
| tree | 52516a1737c3c150196f30b4c6f0da97a016bdc3 /models/crop-requirement.rkt | |
| parent | e082bbe3d61f1186c5758b2be61f793c75dd2439 (diff) | |
Insist on grouped-row naming convention.
Diffstat (limited to 'models/crop-requirement.rkt')
| -rw-r--r-- | models/crop-requirement.rkt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/models/crop-requirement.rkt b/models/crop-requirement.rkt index fd11b06..5ac3f45 100644 --- a/models/crop-requirement.rkt +++ b/models/crop-requirement.rkt @@ -74,8 +74,8 @@ (as nutrients n) #:on (= n.id nv.nutrient_id)))) -(define (grouped-row->crop-requirement row) - (match-define (vector cr-id profile crop-id residuals) row) +(define (grouped-row->crop-requirement grouped-row) + (match-define (vector cr-id profile crop-id residuals) grouped-row) (crop-requirement cr-id profile crop-id (residuals->nutrient-value-hash residuals))) (define (get-crop-requirements) @@ -93,8 +93,7 @@ #:order-by cr.id #:asc) #:group '#(0 1 2))) - (for/list ([row grouped-rows]) - (grouped-row->crop-requirement row))) + (map grouped-row->crop-requirement grouped-rows)) (define (get-crop-requirement #:id [cr-id #f] #:profile [profile #f] #:crop-id [crop-id #f]) (define where @@ -120,7 +119,7 @@ #:group '#(0 1 2))) (match grouped-rows ['() #f] - [(list row) (grouped-row->crop-requirement row)] + [(list grouped-row) (grouped-row->crop-requirement grouped-row)] [many (error 'get-crop-requirement "expected 1 crop requirement, got ~a" (length many))])) (define (get-crop-requirement-values cr-or-id) |