title: single table inheritance with embeds_one mogoid
body: <p>I have a model</p>
  
  <pre><code>class Post
    include Mongoid::Document
    include Mongoid::Timestamps
  
    embeds_one :comment
  end
  </code></pre>
  
  <p>and I have comment class</p>
  
  <pre><code>class Comment
    include Mongoid::Document
    include Mongoid::Timestamps
  
    embedded_in :post
  
    field :title
    field :description
  end
  </code></pre>
  
  <p>And I have another class inherited from comment</p>
  
  <pre><code>class RecentComment &lt; Comment
    # certain methods
  end
  </code></pre>
  
  <p>Now I want to be able to create <code>RecentComment</code> through <code>post</code> if I do <code>Post.last.build_comment(:_type =&gt; "RecentComment")</code> the new comment will not be of <code>_type:"RecentComment"</code>, and similarly if I do <code>Post.last.build_recent_comment</code>, it gives me error saying sth like <code>undefined method build_recent_comment for Post class</code>. If the <code>post</code> had <code>references_many :comments</code> I should have done <code>Post.last.build_comments({}, RecentComment)</code> without any problems. But I don't know about how to build an object with <code>RecentComment</code> class in this case. If anybody could help that'd be gr8!</p>
  
  <p>Note: I am using <code>gem 'mongoid', '~&gt; 2.0.1'</code></p>