title: Using a different key name for an association attribute in rails api active model serializer
body: <p>I am building a <a href="http://en.wikipedia.org/wiki/Representational_state_transfer">Rest API</a> using <a href="https://github.com/rails-api/rails-api/">rails-api</a> and <a href="https://github.com/rails-api/active_model_serializers">active-model-serializer</a> to easily filter the required fields in the JSON. I am also using the <code>has_one</code> association in these serializers. All I wanted to know is how do I specify a different key name for the <code>has_one</code> attribute.</p>
  
  <p>That is, I have two models say: <code>Employee</code> and <code>Address</code>, and there is a <code>has_one :address</code> in  say <code>EmployeeSerializer</code>. The response that I get is:</p>
  
  <pre><code>{
    id: 1,
    address: {
     street: "some_street",
     city: "some_city"
    }
  }
  </code></pre>
  
  <p>But I would like to get the following response:</p>
  
  <pre><code>{
    id: 1,
    stays: {
     street: "some_street",
     city: "some_city"
    }
  }
  </code></pre>
  
  <p>I tried using <code>has_one :address, :key =&gt; :stays</code>, but that doesn't seem to work.</p>