title: how to automatically add a role to a user when signing up using devise
body: <p>I am using Devise 1.1.5. I got a <code>roles</code> and a <code>roles_assignment</code> table. Is it possible to assign a role automatically in my role_assignments table when the user signs up? Many thanks!</p>
  
  <p>I tried this but it wont work</p>
  
  <pre><code>class User &lt; ActiveRecord::Base  
    after_create :assign_role_after_sign_up
  
    protected  
      def assign_role_after_sign_up(user)  
        RoleAssignment.create(:role_id =&gt; 1, :user_id =&gt; user.id)  
      end
  end
  </code></pre>