title: Creating an additional related model with Devise
body: <p>I've started to implement a new project using Devise, which is pretty fantastic for handling users. However, when a user signs up, they're not just creating a <code>User</code> model, but also need to create a related <code>Account</code> model that represents the company. Additional users will also <code>belongs_to</code> this <code>Account</code> model.</p>
  
  <p>I can't seem to find a hook for this in Devise, though it seems like a pretty common pattern. What's the best practice for this?</p>
  
  <p>I should also mention that there are a couple of fields for the <code>Account</code> that need to be provided on the sign_up form, so just something like this in the <code>User</code> model:</p>
  
  <pre><code>  after_create :make_sure_account_exists  
    def make_sure_account_exists
      if self.account.nil?
        @account = self.create_account({ :company_name =&gt; '???' })
    end
  </code></pre>
  
  <p>.. as I'm not sure how to get the company name.</p>