title: Rails polymorphic user model with Devise
body: <p>So I know this question has been ask a ton of times but my question goes a little bit further.  </p>
  
  <p>When modeling my application I have two types of users that have a polymorphic association to the user model. Such as:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
      belongs_to :profileable, :polymorphic =&gt; true
  end
  
  class User_Type_1 &lt; ActiveRecord::Base
      has_one :user, :as =&gt; :profileable
  end
  
  class User_Type_2 &lt; ActiveRecord::Base
      has_one :user, :as =&gt; :profileable
  end
  </code></pre>
  
  <p>The reason I did this, instead of an STI, is because <code>User_Type_1</code> has something like 4 fields and <code>User_Type_2</code> has something like 20 fields and I didn't want the user table to have so many fields (yes 24-ish fields is not a lot but I'd rather not have ~20 fields empty most of the time)</p>
  
  <p>I understand how this works, my question is I want the sign up form to only be used to sign up users of type <code>User_Type_1</code> but the sign in form to be used to both. (I will have an admin side of the application which will create users of <code>User_Type_2</code>)</p>
  
  <p>I know I can use the <code>after_sign_in_path_for(resource)</code> override in <code>AppicationController</code> somehow to redirect to the right part of the site on sign in. Something like:  </p>
  
  <pre><code>def after_sign_in_path_for(resource)
      case current_user.profileable_type
      when "user_type_1"
          return user_type_1_index_path
      when "user_type_2"
          return user_type_1_index_path
      end
  end
  </code></pre>
  
  <p>So I guess my questions are how would I make the form to work with Devise and only allow signups of type <code>User_Type_1</code> and then sign them in after sign_up?</p>
  
  <p>Also, if I am going about this the wrong way, what is the right way?</p>