Hey folks,
I’m trying to keep track of couple of different kinds of “entities” in
my rails app: “people”, “organizations”, and “committees”. I have a
single Entities table in the database, and I’m using Single Table
Inheritance to keep the different subclasses in the same table, with a
field “type”.
My problem comes when allowing the user to correct a mistake – say,
change a “committee” to a more general “organization”.
@entity.update_attributes({:type=>“Organization”}) doesn’t change the
database. I can understand that ruby doesn’t want me changing the class
of an existing object. However, is there a way I can make this change,
while keeping the entity’s same “id” (so I don’t have to change
everywhere that’s referenced)?
Thanks a bunch for your help,
Asa