module Devise::Models::Lockable
def lock_access!(opts = { })
when you lock access, you could pass the next hash
* +opts+: Hash options if you don't want to send email
Lock a user setting its locked_at to actual time.
def lock_access!(opts = { }) self.locked_at = Time.now.utc if unlock_strategy_enabled?(:email) && opts.fetch(:send_instructions, true) send_unlock_instructions else save(validate: false) end end