1
0

Added ingredient source setting/display/import

This commit is contained in:
cryptogopher
2019-09-23 22:33:40 +02:00
parent 0e6bbd8c74
commit 9664df4888
7 changed files with 35 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ class Ingredient < ActiveRecord::Base
belongs_to :project, required: true
belongs_to :ref_unit, class_name: 'Unit', required: true
belongs_to :source, required: false
has_many :nutrients, inverse_of: :ingredient, dependent: :destroy, validate: true
validates :nutrients, presence: true