Add last user login and activity

This commit is contained in:
Patrick Gansterer 2015-03-03 14:55:30 +01:00
parent c59ee3a6a7
commit 700eed27b8
8 changed files with 25 additions and 5 deletions

View file

@ -9,6 +9,7 @@ class SessionsController < ApplicationController
def create
user = User.authenticate(params[:nick], params[:password])
if user
user.update_attribute(:last_login, Time.now)
login user
if session[:return_to].present?
redirect_to_url = session[:return_to]