I am having trouble getting a single table inheritance to work. This is
what I tried I made a base model called Product, made the migration with
all columns for every type of product that I want to create. Also in my
migration I made a column called type to differentiate between classes.
Also, from what I read in AWD I put the :force -> true option after the
table name.
So now I ran the rake db migrate and it made the table. Then I made a
class called DealProduct and I put it in the models folder as
deal_product.rb. I also made it inherit the base class Product. So I
had:
DealProduct < Product
end
So then I made a controller called deal_product, and then I tried
generating the scaffolding for the controller and the DealProduct
controller, and it throws an error saying “Before updating scaffolding
from new DB schema, try creating a table for your model (DealProduct),”
but if I have it inherited from my base class Product, why is it
throwing me this error, shouldn’t it know that it already has one? And
am I even doing this right, is there anything that would make this not
work?
