I am trying to integrate with a Legacy table that has a column named “type”.
Rails will “smartly” assume that whenever we have a ‘type’ column in a table, then it will try to use Single Table Inheritance.
Is there anyway to avoid this?
(I can’t rename the column).
Well, most of the type it really is smart – convention over configuration has some very real benefits. 😉
Where convention doesn’t work, as in your case, there is (probably – at least, I’ve always found one so far…) a way around it. For legacy schemas there are a couple of possibilities that spring immediately to mind.
:typeas the STI indicator usingset_inheritance_column, thus