module ActiveSupport::DescendantsTracker

def store_inherited(klass, descendant)

during the eager loading phase.
This is the only method that is not thread safe, but is only ever called
def store_inherited(klass, descendant)
  (@@direct_descendants[klass] ||= DescendantsArray.new) << descendant
end