title: Mongoid and Postgres Scaffolding/Relationships
body: <p>I have a need for a certain model to contain a reference to a document. Most of the model could be stored in postgres. The model is for a "level" in a game. I'd like to store the level data itself inside of a document, which makes more sense than making a complex tree in sql. </p>
  
  <p>I am able to use postgres with mongoid installed; however, after installing the mongoid gem I seem to only be able to scaffold mongoid (non active record) documents. </p>
  
  <p>The problem is that I have references to other tables, and I don't neccesarily know how to link that up within a mongoid model. </p>
  
  <p>Questions:  </p>
  
  <ol>
  <li><p>How can I force scaffolding to occur with active record instead of mongoid or vice versa.  <strong>Edit:</strong> partly answered here: <a href="https://stackoverflow.com/questions/6372626/using-active-record-generators-after-mongoid-installation">Using Active Record generators after Mongoid installation?</a> (2nd answer works, but I don't know how to go back and forth easily)</p></li>
  <li><p>Is there an easy way to reference a document from an active record model (I know the documentation said don't mix them, but it is ideal for what I am trying to do).   </p></li>
  <li><p>If it is not possible to mix them, then how should I make a document be referenced from a postgres/active record table. In other words how can I get both pieces of data at the same time?  </p></li>
  </ol>
  
  <p>Thanks!</p>