We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54555ea commit 5c2683eCopy full SHA for 5c2683e
1 file changed
app/models/user.rb
@@ -1,6 +1,6 @@
1
class User < ApplicationRecord
2
attribute :terms_and_service, default: false
3
- before_create :generate_activation_token
+ has_secure_token :confirmation_token
4
5
enum :gender, { male: 0, female: 1, other: 2 }
6
@@ -26,12 +26,4 @@ def activate!
26
def activated?
27
email_confirmed?
28
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
37
0 commit comments