Skip to content

Commit 4f6491a

Browse files
author
Julian Nadeau
authored
replace update_attributes with update_columns
1 parent 365e01c commit 4f6491a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/two_factor_authentication/models/two_factor_authenticatable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def generate_totp_secret
101101
def create_direct_otp(options = {})
102102
# Create a new random OTP and store it in the database
103103
digits = options[:length] || self.class.direct_otp_length || 6
104-
update_attributes(
104+
update_columns(
105105
direct_otp: random_base10(digits),
106106
direct_otp_sent_at: Time.now.utc
107107
)
@@ -122,7 +122,7 @@ def direct_otp_expired?
122122
end
123123

124124
def clear_direct_otp
125-
update_attributes(direct_otp: nil, direct_otp_sent_at: nil)
125+
update_columns(direct_otp: nil, direct_otp_sent_at: nil)
126126
end
127127
end
128128

0 commit comments

Comments
 (0)