Use User directly to include legacy otp behavior

This commit is contained in:
Matt Jankowski 2024-04-19 12:22:49 -04:00
parent 864dfc5e79
commit 71ddb52ec6
1 changed files with 1 additions and 6 deletions

View File

@ -3,10 +3,6 @@
class MigrateDeviseTwoFactorSecrets < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
class MigrationUser < ApplicationRecord
self.table_name = :users
end
def up
users_with_otp_enabled.find_each do |user|
# Gets the new value on already-updated users
@ -27,7 +23,6 @@ class MigrateDeviseTwoFactorSecrets < ActiveRecord::Migration[7.1]
private
def users_with_otp_enabled
MigrationUser
.where(otp_required_for_login: true)
User.where(otp_required_for_login: true)
end
end