Guest User

Untitled

a guest
Oct 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def change_password old_password, password, password_confirmation
  2. tap do
  3. self.password, self.password_confirmation = password, password_confirmation
  4. if self.authenticate(old_password)
  5. save
  6. else
  7. self.errors.add :password, message: "is not correct"
  8. end
  9. end
  10. end
Add Comment
Please, Sign In to add comment