module Devise::Models::Lockable

def if_access_locked

if it's locked, otherwise adds an error to email.
Checks whether the record is locked or not, yielding to the block
def if_access_locked
  if access_locked?
    yield
  else
    self.errors.add(:email, :not_locked)
    false
  end
end