module Devise::Models::Lockable

def active_for_authentication?

by verifying whether a user is active to sign in or not based on locked?
Overwrites active_for_authentication? from Devise::Models::Activatable for locking purposes
def active_for_authentication?
  super && !access_locked?
end