What is STI in Rails?

Updated May 24, 2026

Short answer

STI stores multiple model types in one table.

Deep explanation

Uses a type column to differentiate subclasses.

Real-world example

Different user roles stored in one table.

Common mistakes

  • STI causing bloated tables.

Follow-up questions

  • When to avoid STI?
  • Alternatives to STI?

More Ruby on Rails interview questions

View all →