diff --git a/app/models/nutrient.rb b/app/models/nutrient.rb new file mode 100644 index 0000000..b146427 --- /dev/null +++ b/app/models/nutrient.rb @@ -0,0 +1,2 @@ +class Nutrient < ActiveRecord::Base +end diff --git a/db/migrate/001_create_units.rb b/db/migrate/001_create_units.rb index 6f5e3ea..413357f 100644 --- a/db/migrate/001_create_units.rb +++ b/db/migrate/001_create_units.rb @@ -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" diff --git a/test/unit/nutrient_test.rb b/test/unit/nutrient_test.rb new file mode 100644 index 0000000..14e2f04 --- /dev/null +++ b/test/unit/nutrient_test.rb @@ -0,0 +1,9 @@ +require File.expand_path('../../test_helper', __FILE__) + +class NutrientTest < ActiveSupport::TestCase + + # Replace this with your real tests. + def test_truth + assert true + end +end