title: Devise/Devise_invitable: How to skip the pending invitations control
body: <p>I have a Rails/Mongoid application using devise and devise_invitable gems with a special scenario where a User has_and_belongs_to_many groups. This in the application means that a User can be invited to one or more groups by other users. I'm using devise_invitable to handle those invites for both new and existing users.</p>
  
  <p>The scenario where I'm having problems is when a user that has already registered and confirmed its account, and that might have already be invited to one group, is invited to another group. In this case the system sends the new invitation as usual but for the existing User instead of creating a new one to be invited.</p>
  
  <p>If the user confirms the invitation everything works ok, but the problem I'm having is that unless the user confirms it, he/she won't be able to login again into his user account because it will get the alert:</p>
  
  <pre><code>You have a pending invitation, accept it to finish creating your account.
  </code></pre>
  
  <p><strong>So I'm wondering how should I do or what should I override on Devise/Devise_invitable in order to skip that control when trying to login as a user that has already been confirmed but has a pending invitation.</strong> </p>
  
  <p>My User model is this one:</p>
  
  <pre><code>class User
    include Mongoid::Document
    include Mongoid::Attributes::Dynamic
    include Mongoid::Timestamps
    include Mongoid::Userstamp::User
  
    devise :invitable, :encryptable, :database_authenticatable, :registerable, :lockable, :recoverable, :confirmable, :rememberable, :trackable, :validatable, :timeoutable
  
  has_and_belongs_to_many :groups
  </code></pre>
  
  <p>Thanks!</p>