I am very much a rails newbie, so this could be user error, but…
I am trying to implement Single Table Inheritance, and what I find is
that for the base class, and only for that class, the “type” field is
never written out into the database.
To check this out, I created a new project, and created three classes
with scaffold (Rails 2.0.2): Manager < Employee < Person, following
the example in Agile Web D. with Rails. I then edited the
files to set up Single Table Inheritance, which I think I did
correctly. In any event, the controllers appear to work correctly and
it passes the scaffold-generated tests (after necessary fixes).
But I find that when I save an Employee or Manager, the “type” field
is written correctly, but when I save a Person, the type field is
Is this normal, or is this a bug? I can supply a sample project if
PS–if this is a bug, where would be the best place to fix it?
Overriding Person.new, or adding a call-back?