Skip to content

Instantly share code, notes, and snippets.

@phensalves
Created January 5, 2017 16:33
Show Gist options
  • Save phensalves/9ef2ea4755ca71416193dc23cc59debc to your computer and use it in GitHub Desktop.
Save phensalves/9ef2ea4755ca71416193dc23cc59debc to your computer and use it in GitHub Desktop.
veshe
if params[:user][:current_password] #Changing with password
if resource.update_with_password(params[:user])
if is_flashing_format?
flash_key = update_needs_confirmation?(resource, prev_unconfirmed_email) ?
:update_needs_confirmation : :updated
set_flash_message :notice, flash_key
end
sign_in resource_name, resource, bypass: true
respond_with resource, location: after_update_path_for(resource)
else
clean_up_passwords resource
render 'change_password'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment