From f89c5e5b86b26daeed2bd54b2e074c08b0bf9e25 Mon Sep 17 00:00:00 2001 From: Skud Date: Tue, 29 Oct 2013 17:00:32 +1100 Subject: [PATCH] Added plant_part attribute to harvest --- app/models/harvest.rb | 2 +- db/migrate/20131029053113_add_plant_part_to_harvests.rb | 5 +++++ db/schema.rb | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20131029053113_add_plant_part_to_harvests.rb diff --git a/app/models/harvest.rb b/app/models/harvest.rb index d6eda9437..12779a683 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -3,7 +3,7 @@ class Harvest < ActiveRecord::Base friendly_id :harvest_slug, use: :slugged attr_accessible :crop_id, :harvested_at, :description, :owner_id, - :quantity, :unit, :weight_quantity, :weight_unit, :slug + :quantity, :unit, :weight_quantity, :weight_unit, :plant_part, :slug belongs_to :crop belongs_to :owner, :class_name => 'Member' diff --git a/db/migrate/20131029053113_add_plant_part_to_harvests.rb b/db/migrate/20131029053113_add_plant_part_to_harvests.rb new file mode 100644 index 000000000..0619bbb3e --- /dev/null +++ b/db/migrate/20131029053113_add_plant_part_to_harvests.rb @@ -0,0 +1,5 @@ +class AddPlantPartToHarvests < ActiveRecord::Migration + def change + add_column :harvests, :plant_part, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 3a85e3b24..2cd1124d9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20131025104228) do +ActiveRecord::Schema.define(:version => 20131029053113) do create_table "account_types", :force => true do |t| t.string "name", :null => false @@ -105,6 +105,7 @@ ActiveRecord::Schema.define(:version => 20131025104228) do t.string "slug" t.decimal "weight_quantity" t.string "weight_unit" + t.string "plant_part" end create_table "members", :force => true do |t|