Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/travis/api/v3/access_control/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class AccessControl::User < AccessControl::Generic
def initialize(user)
user = Models::User.find(user.id) if user.is_a? ::User
@user = user
user.touch()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove the ()

@access_permissions = user.permissions.where(user_id: user.id)
super()
end
Expand Down
4 changes: 4 additions & 0 deletions lib/travis/api/v3/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def installation
@installation = Models::Installation.find_by(owner_type: 'User', owner_id: id, removed_by_id: nil)
end

def touch
update(last_activity_at: Time.now) if last_activity_at.nil? || Time.now.utc - last_activity_at > 300
end

def github?
vcs_type == 'GithubUser'
end
Expand Down