Skip to content

Commit

Permalink
Add more details
Browse files Browse the repository at this point in the history
  • Loading branch information
simonv3 committed Mar 21, 2015
1 parent 097d0e5 commit 6b287f3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
33 changes: 33 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,37 @@
stratify = FactoryGirl.create(:stage_action_option, name: 'Stratify')
train = FactoryGirl.create(:stage_action_option, name: 'Train')

# Seed the details for each guide.
FactoryGirl.create(:detail_option,
name: 'Greenhouse',
category: 'environment')
FactoryGirl.create(:detail_option, name: 'Potted', category: 'environment')
FactoryGirl.create(:detail_option, name: 'Inside', category: 'environment')
FactoryGirl.create(:detail_option, name: 'Inside', category: 'environment')
outside = FactoryGirl.create(:detail_option,
name: 'Outside',
category: 'environment')


FactoryGirl.create(:detail_option, name: 'Loam', category: 'soil')
FactoryGirl.create(:detail_option, name: 'Clay', category: 'soil')

FactoryGirl.create(:detail_option, name: 'Full Sun', category: 'light')
FactoryGirl.create(:detail_option, name: 'Partial Sun', category: 'light')
FactoryGirl.create(:detail_option, name: 'Shaded', category: 'light')
FactoryGirl.create(:detail_option, name: 'Indirect Light', category: 'light')

FactoryGirl.create(:detail_option, name: 'Organic', category: 'practices')
FactoryGirl.create(:detail_option, name: 'Hydroponic', category: 'practices')
FactoryGirl.create(:detail_option, name: 'Intensive', category: 'practices')
FactoryGirl.create(:detail_option,
name: 'Conventional',
category: 'practices')
FactoryGirl.create(:detail_option,
name: 'Permaculture',
category: 'practices')


prep = FactoryGirl.create(:stage_option, name: 'Preparation', order: 0)
prep.stage_action_options = [water, fertilize, amend, prepare]

Expand Down Expand Up @@ -76,5 +107,7 @@
dormant = FactoryGirl.create(:stage_option, name: 'Dormant', order: 8)
dormant.stage_action_options = [prune, cover, tap]



Guide.all.each{ |gde| gde.update_attributes(user: admin) }
end
8 changes: 8 additions & 0 deletions test/factories/detail_options.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FactoryGirl.define do
factory :detail_option do
name { "#{Faker::Name.last_name}" }
description { Faker::Lorem.sentence }
help { Faker::Lorem.sentence }
category { "#{Faker::Lorem.word}" }
end
end

0 comments on commit 6b287f3

Please sign in to comment.