mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Refactor to use method and override
This commit is contained in:
@@ -127,6 +127,11 @@ module Devise
|
||||
generate_confirmation_token && save(:validate => false)
|
||||
end
|
||||
|
||||
def after_password_reset
|
||||
super
|
||||
confirm! unless confirmed?
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
# Attempt to find a user by it's email. If a record is found, send new
|
||||
# confirmation instructions to it. If not user is found, returns a new user
|
||||
|
||||
@@ -31,7 +31,7 @@ module Devise
|
||||
self.password_confirmation = new_password_confirmation
|
||||
if valid?
|
||||
clear_reset_password_token
|
||||
confirm! if respond_to?(:confirmed?) && !confirmed?
|
||||
after_password_reset
|
||||
end
|
||||
|
||||
save
|
||||
@@ -93,6 +93,9 @@ module Devise
|
||||
self.reset_password_sent_at = nil if respond_to?(:reset_password_sent_at=)
|
||||
end
|
||||
|
||||
def after_password_reset
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
# Attempt to find a user by it's email. If a record is found, send new
|
||||
# password instructions to it. If not user is found, returns a new user
|
||||
|
||||
Reference in New Issue
Block a user