The single-table inheritance mechanism failed to locate the subclass rails

Recently I tried to cre­ate a rails model with a col­umn called “type” and I got the fol­low­ing error

The single-table inheritance mechanism failed to locate the subclass.

Turns out, active record assumes that a ‘type’ field is to indi­cate sin­gle table inher­i­tance. But that wasn’t my intent.
So, here’s the line I added to my model that was rais­ing the error.

self.inheritance_column = nil

Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...