Last active
August 29, 2015 13:57
-
-
Save universal/9601678 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UserPasswordResetsController < ApplicationController | |
| #personal preferences here | |
| def update | |
| user = User.find_by(password_reset_token: params[:id]) | |
| if !user.present? | |
| head :not_found | |
| elsif !(user.is_activated && user.is_active) | |
| head :unprocessable_entity | |
| elsif user.update_password params[:password], params[:password_confirmation] | |
| head :ok | |
| else | |
| @presenter = UserPasswordResetsPresenter.new(user) | |
| render status: :unprocessable_entity | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment