title: Rails - active model serialize an array of hashes within a serializer
body: <p>I am trying to create a nested serialized array of hashes. I have the following so far. It doesn't return the nested serializer but just the array of hashes.</p>
  
  <pre><code>module Api
    module V1
      class ReportShowSerializer &lt; ActiveModel::Serializer
        attributes :name, :schedule, :uuid, :reports
  
         has_many :reports, each_serializer: ReportBuildSerializer
  
        def reports
          [
            {date: '2018-10-04', test: 'a'},
            {date: '2018-10-03', test: 'b'}
          ]
        end
      end
    end
  end
  </code></pre>
  
  <p>and the other serializer</p>
  
  <pre><code>module Api
    module V1
      class ReportBuildSerializer &lt; ActiveModel::Serializer
        attributes :test, :date, :var
  
  
        def var
          "var"
        end
      end
    end
  end
  </code></pre>
  
  <p>but it returns the following</p>
  
  <pre><code>{
      "data": {
          "id": "2",
          "type": "reports",
          "attributes": {
              "name": "Another test report",
              "schedule": "weekly",
              "uuid": "f10736ae-bf5c-4e43-8cd4-35eb0dc12efd",
              "reports": [
                  {
                      "date": "2018-10-04",
                      "test": "ff"
                  },
                  {
                      "date": "2018-10-03",
                      "test": "ff"
                  }
              ]
          }
      }
  }
  </code></pre>
  
  <p>So I don't think it is using the <code>ReportBuildSerializer</code></p>