mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Attempt to fix name lookup for sailorslog leaderboard
This commit is contained in:
@@ -12,7 +12,7 @@ class SailorsLogLeaderboard < ApplicationRecord
|
||||
|
||||
stats.each_with_index do |entry, index|
|
||||
medal = medals[index] || "white_small_square"
|
||||
msg += "\n:#{medal}: `@#{SlackUsername.find_by_uid(entry[:user_id])}`: #{short_time_simple entry[:duration]} → "
|
||||
msg += "\n:#{medal}: `@#{entry[:name]}`: #{short_time_simple entry[:duration]} → "
|
||||
msg += entry[:projects].map do |project|
|
||||
language = project[:language_emoji] ? "#{project[:language_emoji]} #{project[:language]}" : project[:language]
|
||||
|
||||
@@ -76,8 +76,10 @@ class SailorsLogLeaderboard < ApplicationRecord
|
||||
|
||||
projects = projects.filter { |project| project[:duration] > 1.minute }.sort_by { |project| -project[:duration] }
|
||||
|
||||
user = User.find user_id
|
||||
{
|
||||
user_id: user_id,
|
||||
slack_uid: user.slack_uid,
|
||||
name: SlackUsername.find_by_uid(user.slack_uid),
|
||||
duration: user_durations[user_id],
|
||||
projects: projects
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user