title: uninitialized constant API::V1::ApplicationSerializer
body: <p>I'm started using <code>gem 'active_model_serializers', '~&gt; 0.10.0'</code>. Following <a href="https://github.com/rails-api/active_model_serializers/blob/0-10-stable/docs/general/getting_started.md" rel="nofollow noreferrer">this</a> document 
  for the implementation. </p>
  
  <p>I have the following relations.</p>
  
  <pre><code>landmark has_many concerns
  concern belongs_to landmark
  concern has_many comments 
  </code></pre>
  
  <p>I have created a <code>ApplicationSerializer</code> at <code>app/serializers/api/application_serializer.rb</code></p>
  
  <pre><code>module API
    class ApplicationSerializer &lt; ActiveModel::Serializer
       # some commode here
    end
  end
  </code></pre>
  
  <p>My concern_serializer contains:</p>
  
  <pre><code># ===&gt; Does not work &lt;=====
  module API::V1
    class ConcernSerializer &lt; ApplicationSerializer
      attributes :id, :body
      has_many :comments
      belongs_to :landmark
  
      class CommentSerializer &lt; ApplicationSerializer
        attributes :id, :body
      end
  
      class LandmarkSerializer &lt; ApplicationSerializer
        attributes :id, :short_address
      end
  
    end
  end
  
  
  # ====&gt; However, this works &lt;====
  module API::V1
    class ConcernSerializer &lt; ApplicationSerializer
      attributes :id, :body
      has_many :comments
  
      class CommentSerializer &lt; ActiveModel::Serializer
        attributes :id, :body
      end
  
    end
  end
  
  # ===&gt; Does not work again&lt;=====
  module API::V1
    class ConcernSerializer &lt; ApplicationSerializer
      attributes :id, :body
      has_many :comments
      belongs_to :landmark
  
      class CommentSerializer &lt; ActiveModel::Serializer
        attributes :id, :body
      end
  
      class LandmarkSerializer &lt; ActiveModel::Serializer
        attributes :id, :short_address
      end
  
    end
  end
  </code></pre>
  
  <p>In the above code if I replace <code>ApplicationSerializer</code> with <code>ActiveModel::Serializer</code> it works fine but I lose the common code defined in <code>ApplicationSerializer</code>.</p>