mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Updating controllers to scope resource_class and changing mapping implementation to reload mapped class based on cache_classes configuration.
This commit is contained in:
@@ -10,7 +10,7 @@ class PasswordsController < ApplicationController
|
||||
# POST /password
|
||||
#
|
||||
def create
|
||||
self.resource = User.send_reset_password_instructions(params[resource_name])
|
||||
self.resource = resource_class.send_reset_password_instructions(params[resource_name])
|
||||
if resource.errors.empty?
|
||||
flash[:notice] = I18n.t(:send_instructions, :scope => [:devise, :passwords], :default => 'You will receive an email with instructions about how to reset your password in a few minutes.')
|
||||
redirect_to new_session_path
|
||||
@@ -22,14 +22,14 @@ class PasswordsController < ApplicationController
|
||||
# GET /password/edit?perishable_token=abcdef
|
||||
#
|
||||
def edit
|
||||
self.resource = User.new
|
||||
self.resource = resource_class.new
|
||||
resource.perishable_token = params[:perishable_token]
|
||||
end
|
||||
|
||||
# PUT /password
|
||||
#
|
||||
def update
|
||||
self.resource = User.reset_password!(params[resource_name])
|
||||
self.resource = resource_class.reset_password!(params[resource_name])
|
||||
if resource.errors.empty?
|
||||
flash[:notice] = I18n.t(:update, :scope => [:devise, :passwords], :default => 'Your password was changed successfully.')
|
||||
redirect_to new_session_path
|
||||
|
||||
Reference in New Issue
Block a user