summaryrefslogtreecommitdiff
path: root/app/helpers/recipes_helper.rb
diff options
context:
space:
mode:
authorMarius Peter <dev@marius-peter.com>2025-09-04 20:55:03 +0200
committerMarius Peter <dev@marius-peter.com>2025-09-04 20:55:03 +0200
commit8ba568ae0ebe715b5da453681eb141886f1977a8 (patch)
tree3bf3a3d5b41286d0a6da8895857314393bae1db2 /app/helpers/recipes_helper.rb
parent8f8cea2a0408918629dc8bab03495530861a71f3 (diff)
Simpler, Better, Faster... StrongerHEADmaster
Start small, address critical customer needs, /then/ scale.
Diffstat (limited to 'app/helpers/recipes_helper.rb')
-rw-r--r--app/helpers/recipes_helper.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/app/helpers/recipes_helper.rb b/app/helpers/recipes_helper.rb
deleted file mode 100644
index 02cb1a7..0000000
--- a/app/helpers/recipes_helper.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-module RecipesHelper
- def commercial_name_for(component)
- # Try to find a FertilizerProduct via a join, but gracefully fallback.
- if defined?(FertilizerProduct) && defined?(FertilizerComposition)
- prod = FertilizerProduct.joins(:fertilizer_compositions)
- .where(fertilizer_compositions: { fertilizer_component_id: component.id })
- .first
- return prod.name if prod&.name.present?
- end
- component.name.presence || component.formula
- end
-
- def fmt_kg(v)
- number_with_precision(v.to_f, precision: 2, strip_insignificant_zeros: true)
- end
-end
Copyright 2019--2025 Marius PETER