title: get auto_increment value, with build?
body: <p>In my user registration routine, i have this code :</p>
  
  <pre><code>@user = User.new(attribs)  
  
  @user.build_inventory(:max_slots =&gt; 10) # create the user inventory, starting with 10 slots
  
  success = @user &amp;&amp; @user.save
  if success &amp;&amp; @user.errors.empty?
  </code></pre>
  
  <p>This works great in creating an inventory and a user bound to that inventory. However, now i want to add a new inventory_item in every registration. I tried something like :</p>
  
  <pre><code>@user = User.new(attribs)  
  
  inventory = @user.build_inventory(:max_slots =&gt; 10) # create the user inventory, starting with 10 slots
  InventoryItem.create(:inventory_id =&gt; inventory.id, :game_item =&gt; GameItem.find_by_name('Fist'), :is_equipped =&gt; 1)
  </code></pre>
  
  <p>I thought it would not work (beacuse inventory is not built before inventory_item, and of course it didn't. What is the correct way to do that ?</p>