ItemI took advantage of the rspec generator to create the scaffolding, but still only use one table for both Food and PersonalHygiene.
Food
PersonalHygiene
script/generate rspec_scaffold item type:string name:string unit:string quantity:string
script/generate rspec_scaffold food name:string unit:string quantity:string
script/generate rspec_scaffold personal_hygiene name:string unit:string quantity:string
Once I did this, I went back and removed the migrations for Food and PersonalHygiene and changed those models to inherit from Item.
rake db:migrate
rake spec
No comments:
Post a Comment