1
0

Preliminary Target #new support

This commit is contained in:
cryptogopher
2020-06-27 21:52:32 +02:00
parent 1dd2e2b596
commit 0df2c6ec4f
18 changed files with 177 additions and 26 deletions

View File

@@ -29,7 +29,11 @@ module BodyTracking::ProjectPatch
has_many :meal_quantities, -> { order "lft" }, through: :meal_exposures,
source: 'quantity'
has_many :thresholds, through: :quantities
has_many :targets, through: :thresholds, source_type: 'Target'
has_many :goals, dependent: :destroy do
def binding
find_or_create_by(name: "binding")
end
end
has_many :targets, through: :goals
end
end