mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
Update last login field when validating existing login. Show 25 users in the user list instead of just ten.
This commit is contained in:
parent
318e4a22e4
commit
2d02f2f262
3 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ class User < ApplicationRecord
|
||||||
|
|
||||||
#for will_paginate plugin
|
#for will_paginate plugin
|
||||||
cattr_accessor :per_page
|
cattr_accessor :per_page
|
||||||
@@per_page = 10
|
@@per_page = 25
|
||||||
|
|
||||||
has_many(:contexts, -> { order 'position ASC' }, dependent: :delete_all) do
|
has_many(:contexts, -> { order 'position ASC' }, dependent: :delete_all) do
|
||||||
def find_by_params(params)
|
def find_by_params(params)
|
||||||
|
|
|
@ -152,6 +152,7 @@ module LoginSystem
|
||||||
|
|
||||||
def set_current_user(user)
|
def set_current_user(user)
|
||||||
@user = user
|
@user = user
|
||||||
|
User.update(@user.id, last_login_at: Time.zone.now)
|
||||||
end
|
end
|
||||||
|
|
||||||
# overwrite if you want to have special behavior in case the user is not authorized
|
# overwrite if you want to have special behavior in case the user is not authorized
|
||||||
|
|
|
@ -21,4 +21,3 @@ class Rack::PathInfoRewriter
|
||||||
end
|
end
|
||||||
|
|
||||||
Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Tracksapp::Application)
|
Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Tracksapp::Application)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue