Remove `TotpRecoveryCode.remove_all_for(user)` method

This commit is contained in:
Dominik Kwiatek 2020-11-15 22:09:27 +01:00
parent 2e6f49819a
commit 277799ff4b
1 changed files with 0 additions and 6 deletions

View File

@ -8,10 +8,4 @@ class TotpRecoveryCode < ApplicationRecord
def self.generate_for(user) def self.generate_for(user)
TotpRecoveryCode.create!(Array.new(16) { {user: user, code: SecureRandom.base58(8).downcase} }) TotpRecoveryCode.create!(Array.new(16) { {user: user, code: SecureRandom.base58(8).downcase} })
end end
# @param user [User]
# @return [Integer]
def self.remove_all_for(user)
TotpRecoveryCode.where(user: user).delete_all
end
end end