Prevent STI when inheriting from an ActiveRecord model

Viewed 11584

On Rails 3.2.6, I have a class that inherits from ActiveRecord::Base:

class Section < ActiveRecord::Base
  ...
end

When I inherit from this class, Rails will assume I want STI:

class AnotherSection < Section
   ..Rails assumes I have a type field, etc...
end

I want to be able to inherit from the Section class and use the subclass as a normal Ruby subclass, without the Rails STI magic.

Is there a way to prevent STI when subclassing from an ActiveRecord::Base model?

3 Answers
Related