Replaced Quantity 'primary' attr with ColumnView model
This commit is contained in:
@@ -5,8 +5,13 @@ module BodyTracking
|
||||
has_many :ingredients, -> { order "name" }, dependent: :destroy
|
||||
|
||||
has_many :sources, dependent: :destroy
|
||||
has_many :column_views, dependent: :destroy
|
||||
has_many :quantities, -> { order "lft" }, dependent: :destroy
|
||||
has_many :units, dependent: :destroy
|
||||
|
||||
def nutrients_column_view
|
||||
self.column_views.find_or_create_by(name: 'Nutrients', domain: :diet)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user