Module: Clearance::User

Extended by:
ActiveSupport::Concern
Included in:
User
Defined in:
lib/clearance/user.rb

Defined Under Namespace

Modules: Callbacks, ClassMethods, Validations

Instance Method Summary collapse

Instance Method Details

#forgot_password!Object



64
65
66
67
# File 'lib/clearance/user.rb', line 64

def forgot_password!
  generate_confirmation_token
  save :validate => false
end

#reset_remember_token!Object



69
70
71
72
# File 'lib/clearance/user.rb', line 69

def reset_remember_token!
  generate_remember_token
  save :validate => false
end

#update_password(new_password) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/clearance/user.rb', line 74

def update_password(new_password)
  self.password_changing = true
  self.password = new_password

  if valid?
    self.confirmation_token = nil
    generate_remember_token
  end

  save
end