Skip to content

Commit 5c2683e

Browse files
committed
confirmation token again
1 parent 54555ea commit 5c2683e

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

app/models/user.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class User < ApplicationRecord
22
attribute :terms_and_service, default: false
3-
before_create :generate_activation_token
3+
has_secure_token :confirmation_token
44

55
enum :gender, { male: 0, female: 1, other: 2 }
66

@@ -26,12 +26,4 @@ def activate!
2626
def activated?
2727
email_confirmed?
2828
end
29-
30-
private
31-
32-
def generate_activation_token
33-
self.confirmation_token = SecureRandom.urlsafe_base64
34-
self.email_confirmed = false
35-
self.email_verified_at = nil
36-
end
3729
end

0 commit comments

Comments
 (0)