1
0

Renamed Ingredient -> Food

Ingredient is now part of composition (meal/recipe/dish)
This commit is contained in:
cryptogopher
2020-04-14 19:44:19 +02:00
parent c3010a70e8
commit 8e8160c41a
46 changed files with 204 additions and 199 deletions

View File

@@ -1,10 +1,10 @@
module BodyTracking
module ItemsWithQuantities
RELATIONS = {
'Ingredient' => {
'Food' => {
domain: :diet,
subitem_class: Nutrient,
foreign_key: :ingredient_id,
foreign_key: :food_id,
value_field: :amount
},
'Measurement' => {

View File

@@ -5,7 +5,7 @@ module BodyTracking::ProjectPatch
has_many :measurement_routines, dependent: :destroy
has_many :measurements, -> { order "taken_at DESC" }, dependent: :destroy,
extend: BodyTracking::ItemsWithQuantities, through: :measurement_routines
has_many :ingredients, -> { order "name" }, dependent: :destroy,
has_many :foods, -> { order "name" }, dependent: :destroy,
extend: BodyTracking::ItemsWithQuantities
has_many :sources, dependent: :destroy