Commit e89b7f9f by Hoang Nam Nguyen

'fixed again'

parent 2bd3583d
class PasswordResetsController < ApplicationController
before_action :get_user, only: [:edit, :update]
before_action :valid_user, only: [:edit, :update]
before_action :check_expiration, only: [:edit, :update]
before_action :get_user, :valid_user, :check_expiration, only: [:edit, :update]
def new
end
......
......@@ -27,8 +27,7 @@ class UsersController < ApplicationController
@user.validate_password = true
if @user.update_attributes(user_params)
@user.update_attributes(:activated => true)
@user.update_attributes(:activated_at => Time.zone.now)
@user.update_attributes(:activated => true,:activated_at => Time.zone.now)
flash[:success] = "Update success"
redirect_to my_page_path
else
......
......@@ -23,8 +23,7 @@ class User < ApplicationRecord
def create_reset_digest
self.reset_token = generate_token
update_attributes(:reset_digest => digest(reset_token))
update_attributes(:reset_sent_at => Time.zone.now)
update_attributes(:reset_digest => digest(reset_token),:reset_sent_at => Time.zone.now)
end
def send_password_reset_email
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment