Skip to content
Browse files

Removed User#initialize_confirmation_token from before_save; added #g…

…enerate_confirmation_token to before_create
  • Loading branch information...
1 parent 58e05e2 commit 1448735e15ec839c4e3b50b6f42e750c23bdd5da @rmm5t rmm5t committed Sep 29, 2009
Showing with 2 additions and 7 deletions.
  1. +2 −7 lib/clearance/user.rb
View
9 lib/clearance/user.rb
@@ -66,9 +66,8 @@ module Callbacks
def self.included(model)
model.class_eval do
before_save :initialize_salt,
- :encrypt_password,
- :initialize_confirmation_token
-
+ :encrypt_password
+ before_create :generate_confirmation_token
after_create :send_confirmation_email, :unless => :email_confirmed?
end
end
@@ -165,10 +164,6 @@ def generate_remember_token
self.remember_token = encrypt("--#{Time.now.utc}--#{encrypted_password}--#{id}--")
end
- def initialize_confirmation_token
- generate_confirmation_token if new_record?
- end
-
def password_required?
encrypted_password.blank? || !password.blank?
end

0 comments on commit 1448735

Please sign in to comment.
Something went wrong with that request. Please try again.