View tracking through params in Ingredients
Squeezed ingredient form
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user