Not getting all the attribute for has_one serializer
<p>I have <code>User (name:string, email:string, admin_id:integer)</code> model and <code>admin_profile (id:integer, type:string, address:text, skills:string)</code> model</p>

<blockquote>
  <p>User has_one admin_profile if admin_id is present.</p>
</blockquote>

<p>Here is the serializer</p>

<pre><code>class UserSerializer &lt; ActiveModel::Serializer
  attributes :name, :email, :admin_id
  has_one :admin_profile, :if =&gt; :admin_id?
end
</code></pre>

<p>The problem is that I am only getting id and type when from the api when I render user. Is there a way to include all the admin_profile attributes in user if user is admin?</p>