From c6912295556d85eb0ae29186b9dbd65d9fe8d77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Thu, 14 Oct 2021 11:47:03 +0200 Subject: [PATCH] pluck existing unit in form --- app/models/p_spec_value.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/p_spec_value.rb b/app/models/p_spec_value.rb index 8471de5..c9aade6 100644 --- a/app/models/p_spec_value.rb +++ b/app/models/p_spec_value.rb @@ -1,7 +1,7 @@ class PSpecValue < ApplicationRecord has_many :p_product_ref_specs - UNITS = ["Go", "Mo"] + UNITS = self.distinct.pluck(:unit) def member_label "#{value} #{unit}"