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

View file

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