title: devise and multiple "user" models
body: <p>I'm using rails 3.2 and devise 2.0 and I'm quite new to Rails.</p>
  
  <h1>Requirements</h1>
  
  <p>I'd like to achieve the following:</p>
  
  <ul>
  <li>have 2 or more "user" models, eg. Member, Customer, Admin</li>
  <li>all models share some required fields (eg. email and password)</li>
  <li>each model may have some unique fields (eg. company for Customer only)</li>
  <li>some fields may be shared but not have the same validation (eg. name is required for Customer but optional for Member)</li>
  <li>all fields must be filled during the registration process, so the forms are different</li>
  <li>the login form should be unique</li>
  </ul>
  
  <h1>Possible solutions</h1>
  
  <p>I googled and searched StackOverflow for quite a long time, but nothing seems right to me (I'm a Java guy, sorry :) and now I'm quite confused. Two solutions came up:</p>
  
  <h2>Single devise user</h2>
  
  <p>That's the most frequent answer. Just create the default devise User and create relations between Member-->User and Customer-->User.
  My concern here is how can I achieve a customized registration process for each model? I tried different things but all ended as a mess!</p>
  
  <h2>Multiple devise users</h2>
  
  <p>This solves the custom registration process, and seems right to me, but the unique login form is a blocker. I found an answer on SO (<a href="https://stackoverflow.com/questions/7254734/devise-login-from-two-model">Devise - login from two model</a>) which suggests to override Devise::Models::Authenticatable.find_for_authentication(conditions).
  That seems complicated (?) and since I'm new to rails, I'd like to know if that could work?</p>
  
  <p>Thanks for your advice!</p>