title: serializing array when nested with other attributes in rails 5
body: <p>I have a ruby (2.4.0p0) rails (5.0.2) controller from which I wish to return a json result containing a list of Thing objects as well as some high level info (such as next and previous from Kaminari paging).</p>
  
  <p>Consider a Thing with an association to Owner. Thing has a owner_id attribute.</p>
  
  <p>For @things = Thing.page(1).per(2) I will be able to use </p>
  
  <p>render json: @things</p>
  
  <p>and get;</p>
  
  <pre><code>[
      { "id": 1, "owner_id": 1, "name": "thing1" },
      { "id": 2, "owner_id": 1, "name": "thing2" }
  ]
  </code></pre>
  
  <p>Good.  If I then create a serializer called ThingSerializer.rb and define owner such that it adds "owner":"CatInHat" instead of "owner_id":1
  This works as well;</p>
  
  <pre><code>[
      { "id": 1, "owner": "CatInHat", "name": "thing1" },
      { "id": 2, "owner": "CatInHat", "name": "thing2" }
  ]
  </code></pre>
  
  <p>This is good, but, my problem comes when I want to add higher level data and label the list as "results" such as when I try;</p>
  
  <p>render json: { next:"some_url_link",previous:"some_other_url_link", results: @bags}</p>
  
  <p>I'd like to get;</p>
  
  <pre><code>{ "next":some_url_link,
      "prev":some_other_url_link,
      "results":[ { "id": 1, "owner": "CatInHat", "name": "thing1" }, { "id": 2, "owner": "CatInHat", "name": "thing2" } ]
  }
  </code></pre>
  
  <p>What I get is nearly the above but with "owner_id":1 instead of "owner":"CatInHat" - my serializer does not seem to be used when I label and nest my list of things.  What is the appropriate way to use my serializer and get this output?</p>
  
  <p>If I create config/initializers/active_model_serializers.rb and add 
      ActiveModel::Serializer.config.adapter = :json_api
  It gives me an api which is similar but I don't know if it can be customized to fit the spec I need above.</p>
  
  <p>thank you for any help</p>