diff options
Diffstat (limited to 'models/fertilizer-product.rkt')
| -rw-r--r-- | models/fertilizer-product.rkt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/fertilizer-product.rkt b/models/fertilizer-product.rkt index 0a6c03d..b93f082 100644 --- a/models/fertilizer-product.rkt +++ b/models/fertilizer-product.rkt @@ -32,6 +32,12 @@ ;; Instances of this struct are persisted in the fertilizer_products table. (struct fertilizer-product (id canonical-name nutrient-values brand-name) #:transparent + #:guard + (λ (id canonical-name nutrient-values brand-name _) + (values id + canonical-name + nutrient-values + (if (sql-null? brand-name) #f brand-name))) #:property prop:custom-write (λ (v out _mode) (fprintf out "Fertilizer #~a\n" (fertilizer-product-id v)) |