1
0

View tracking through params in Ingredients

Squeezed ingredient form
This commit is contained in:
cryptogopher
2020-04-04 02:13:46 +02:00
parent 738161fc43
commit f00f93c9e9
17 changed files with 47 additions and 62 deletions

View File

@@ -5,10 +5,4 @@ class Nutrient < ActiveRecord::Base
validates :quantity, uniqueness: {scope: :ingredient_id}
validates :amount, numericality: {greater_than_or_equal_to: 0.0}
after_initialize do
if new_record?
self.unit ||= self.ingredient.ref_unit
end
end
end