hackatime/app/models/currently_hacking.rb
Mahad Kalam ef3f36c829
Inertia migration/UI3 (#911)
* Inertia p1?

* Inertia'fied signed out homepage?

* Split up signed in page

* WIP signed in v2?

* Better signed in?

* Clean up extensions page!

* Fix currently hacking

* Better docs page?

* Docs update 2

* Clean up "What is Hackatime?" + get rid of that godawful green dev mode

* Better nav?

* Cleaner settings?

* Fix commit times

* Fix flashes + OS improv

* Setup v2

* Readd some of the syncers?

* Remove stray emdash

* Clean up Step 3

* Oops, remove .vite

* bye bye, /inertia-example

* bin/rubocop -A

* Fix docs vuln
2026-02-09 11:26:30 +00:00

21 lines
549 B
Ruby

# frozen_string_literal: true
class CurrentlyHacking
def self.count
Cache::CurrentlyHackingCountJob.perform_now[:count]
end
def self.active_users
data = Cache::CurrentlyHackingJob.perform_now
data[:users].map do |user|
project = data[:active_projects][user.id]
{
id: user.id,
display_name: user.display_name,
slack_uid: user.slack_uid,
avatar_url: user.avatar_url,
active_project: project && { name: project.project_name, repo_url: project.repo_url }
}
end
end
end