Skip to content

recording user last activity timestamp #1354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
Prev Previous commit
Merge branch 'master' into ga-tbt279-user_activity
  • Loading branch information
gbarc-dt committed Feb 18, 2025
commit b6a970b2a5550edf25c853fc15f42f1df604d5b3
12 changes: 12 additions & 0 deletions lib/travis/api/v3/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ def touch
update(last_activity_at: Time.now) if last_activity_at.nil? || Time.now.utc - last_activity_at > 300
end

def internal?
!!get_internal_user
end

def get_internal_user
Travis.config[:internal_users]&.find { |item| item[:id] == id }
end

def login
read_attribute(:login) || get_internal_user&.dig(:login)
end

def github?
vcs_type == 'GithubUser'
end
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.