Added nutrient model
command: rails generate redmine_plugin_model body_tracking nutrient ingredient:references quantity:references unit:references amount:decimal
This commit is contained in:
@@ -19,13 +19,20 @@ class CreateUnits < ActiveRecord::Migration
|
||||
|
||||
create_table :ingredients do |t|
|
||||
t.string :name
|
||||
t.references :ref_unit
|
||||
t.decimal :ref_amount
|
||||
t.references :ref_unit
|
||||
t.boolean :hidden
|
||||
t.references :source
|
||||
t.integer :group
|
||||
end
|
||||
|
||||
create_table :nutrients do |t|
|
||||
t.references :ingredient
|
||||
t.references :quantity
|
||||
t.references :unit
|
||||
t.decimal :amount
|
||||
end
|
||||
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
Unit.create project: nil, shortname: "%", name: "percent"
|
||||
|
||||
Reference in New Issue
Block a user