In short, single inheritance (STI) is a design pattern that allows you to map OOP inheritance relationships to a database. If you are defining any subclasses of objects in the ActiveRecord model, you should consider STI.
STI is (originally?) Documented in Martin Fowler’s book, "Models of Enterprise Application Architecture," and also described in DHH canonical Rails book "Agile Web Development with Rails" (section 18.4, I think.) I refer you to these books because they give a much better explanation than I could hope to do in this space.
I strongly disagree with the expression expressed at www.matthewpaulmoore.com (linked by robintw in this thread) that STI is inherently bad. This seems like a somewhat naive idea that there are discounts on using OOP inheritance. I used STI to create elegant solutions in Rails, but you can abuse any design pattern, I suppose.
source share