ActiveRecord::SubclassNotFound ActiveRecord::SubclassNotFound ruby ruby

ActiveRecord::SubclassNotFound


If anyone else stumbles here there are two ways to fix the problem

  1. Don't use a column named type.
  2. Manually set the column name to something pointless:

    self.inheritance_column = :_type_disabled

    See: http://apidock.com/rails/ActiveRecord/Base/inheritance_column/class


The single-table inheritance error is probably caused by a column named type in your database.

If rails encounters a column name called type it assumes it's a Model that has Subclasses so the type discriminates what model to use. I guess some plugin that was not originally built for rails uses a type column in it's model and that causes Rails to fail.