mhuggins / multiple_table_inheritance

Multiple Table Inheritance is a plugin designed to allow for multiple table inheritance between your database tables and your ActiveRecord models.
30 stars 4 forks source link

Renaming subtype doesn't work #6

Closed danivalentin closed 12 years ago

danivalentin commented 12 years ago

I renamed the subtype column as stated in the readme to "type" (btw, there is an extra comma there) and it doesn't work. I have the error that it can't find the child class without the id.

mhuggins commented 12 years ago

I believe "type" is a reserved word in Rails, which is why I named the column "subtype" in the first place. Can you try with a different column name to see if that fixes the issue? If that's the cause of the problem, I'll update the README to make it more clear that "type" is reserved / should not be used.

danivalentin commented 12 years ago

You are right about this, it seems that type is a reserved word for ActiveRecord. Just changed for something else and it worked, I'm closing this issue. Thanks

mhuggins commented 12 years ago

Thanks for the update. I've made a change to the README to include this important point.