title: Get a list/array of child classes from Single Table Inheritance in Rails?
body: <p>I have a whole bunch of child classes that inherit from a parent class via single-table-inheritance in my Rails app. I'd like a way to get an array of all the child classes that inherit from the main class. </p>
  
  <p>I tried the following single-link command that I found in another SO answer, but it only returns the parent class.</p>
  
  <pre><code>ObjectSpace.each_object(class&lt;&lt;MyParentClass;self;end)
  </code></pre>
  
  <p>Is there any clean way to do this?</p>
  
  <p><strong>EDIT:</strong>
  Apparently Rails only lazy-loads child classes when called in Dev mode, and possibly production depending on the Rails version. However, the first answer should work on Rails 3.1 and higher in Prod mode.</p>