Method: Devise::Models::Lockable#if_access_locked

Defined in:
lib/devise/models/lockable.rb

#if_access_lockedObject (protected)

Checks whether the record is locked or not, yielding to the block if it’s locked, otherwise adds an error to email.



162
163
164
165
166
167
168
169
# File 'lib/devise/models/lockable.rb', line 162

def if_access_locked
  if access_locked?
    yield
  else
    self.errors.add(Devise.unlock_keys.first, :not_locked)
    false
  end
end