From 50e59fb9bdd23733c659e888df69508a9f887e15 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 16 Jul 2018 10:12:19 +0800 Subject: [PATCH] Fix the build. --- app/models/user_second_factor.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user_second_factor.rb b/app/models/user_second_factor.rb index 6ca613a8f6a..2cb71049899 100644 --- a/app/models/user_second_factor.rb +++ b/app/models/user_second_factor.rb @@ -1,10 +1,6 @@ class UserSecondFactor < ActiveRecord::Base belongs_to :user - scope :totp, -> do - where(method: UserSecondFactor.methods[:totp]) - end - scope :backup_codes, -> do where(method: UserSecondFactor.methods[:backup_codes], enabled: true) end @@ -16,6 +12,10 @@ class UserSecondFactor < ActiveRecord::Base ) end + def self.totp + where(method: self.methods[:totp]).first + end + end # == Schema Information