-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
minhyeok92
committed
Aug 20, 2014
1 parent
d8b049b
commit 445f1e2
Showing
4 changed files
with
71 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
class Users::RegistrationsController < Devise::RegistrationsController | ||
skip_before_action :is_nickname_not_empty? | ||
end | ||
|
||
def update | ||
if current_user.provider == nil | ||
super | ||
else | ||
account_update_params = devise_parameter_sanitizer.sanitize(:account_update) | ||
|
||
# required for settings form to submit when password is left blank | ||
if account_update_params[:password].blank? | ||
account_update_params.delete("password") | ||
account_update_params.delete("password_confirmation") | ||
account_update_params.delete("current_password") | ||
end | ||
|
||
@user = User.find(current_user.id) | ||
if @user.update_attributes(account_update_params) | ||
set_flash_message :notice, :updated | ||
# Sign in the user bypassing validation in case their password changed | ||
sign_in @user, :bypass => true | ||
redirect_to after_update_path_for(@user) | ||
else | ||
render "edit" | ||
end | ||
end | ||
end | ||
end |
This file contains 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
445f1e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#41