Skip to content

Instantly share code, notes, and snippets.

@superp
Created March 25, 2011 13:56
Show Gist options
  • Save superp/886862 to your computer and use it in GitHub Desktop.
Save superp/886862 to your computer and use it in GitHub Desktop.
overwrite update_with_password
# in User model
def update_with_password(params={})
unless params.key?(:current_password)
if params[:password].blank?
params.delete(:password)
params.delete(:password_confirmation) if params[:password_confirmation].blank?
end
update_attributes(params)
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment