Sha256: e369dc419d0ff2662b56ee2f365b7ffe980a5c06e362ec3e5aab71ef12cfd8a2
Contents?: true
Size: 631 Bytes
Versions: 5
Compression:
Stored size: 631 Bytes
Contents
module Devise module Models module Recoverable module ClassMethods def reset_password_by_token(attributes={}) recoverable = find_or_initialize_with_error_by(:reset_password_token, attributes[:reset_password_token]) if recoverable.persisted? recoverable.reset_password!(attributes[:password], attributes[:password_confirmation]) if recoverable.errors.empty? recoverable.failed_attempts = 0 recoverable.save(:validate => false) end end recoverable end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems