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 tha
Rails extends Ruby Class with the subclasses() method.
Class
In Rails 3 you can call it directly:
YourClass.subclasses
In Rails 2.3, ".subclasses" is protected, so we use have to call it using send():
send()
YourClass.send(:subclasses)