1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/models/ingredient.rb
cryptogopher e78803e474 Added MealsController#new and form autocomplete for Food
Renamed QuantityColumn -> Exposure
2020-04-15 23:42:58 +02:00

9 lines
324 B
Ruby

class Ingredient < ActiveRecord::Base
belongs_to :composition, inverse_of: :ingredients, required: true
belongs_to :food, required: true
belongs_to :part_of, required: false
validates :ready_ratio, numericality: {greater_than_or_equal_to: 0.0}
validates :amount, numericality: {greater_than_or_equal_to: 0.0}
end