title: How to require folder with inherited classes?
body: <p>I have a directory with classes which inherits each other:</p>
  
  <pre><code># auth_serializer.rb
  class AuthSerializer &lt; UserSerializer
  end
  
  # user_serializer.rb
  class UserSerializer
  end
  </code></pre>
  
  <p>I require it this way:</p>
  
  <pre><code>Dir[File.expand_path('./**/*.rb', __dir__)].each do |f|
    require f
  end
  </code></pre>
  
  <p>And have an error:</p>
  
  <pre><code>  uninitialized constant UserSerializer
    # ./app/serializers/auth_serializer.rb:1:in `&lt;top (required)&gt;'
  </code></pre>
  
  <p>I understand why this error happens - because <strong>AuthSerializer</strong> required before <strong>UserSerializer</strong>. How to require a bunch of files without this error? I don't want to rename <code>user_serializer.rb</code> into <code>0_user_serializer.rb</code> or make custom order of require for each time when this error happens.</p>