module Devise::Models::Confirmable

def active?

calculate if the confirm time has not expired for this user.
is already confirmed, it should never be blocked. Otherwise we need to
by verifying whether an user is active to sign in or not. If the user
Overwrites active? from Devise::Models::Activatable for confirmation
def active?
  super && (!confirmation_required? || confirmed? || confirmation_period_valid?)
end