JerryM
(JerryM)
January 2, 2025, 5:22pm
1
For some reason I was really looking forward to this… I guess i just neglected the “by whom” portion. No badge for reading a days worth in the first month?
petro
(Petro)
January 2, 2025, 8:00pm
2
So, I looked into it. The algo for it is here
end
end
def scores(min_user_created_at, max_user_created_at)
current_owners = UserBadge.where(badge_id: Badge::NewUserOfTheMonth).pluck(:user_id)
current_owners = [-1] if current_owners.blank?
# Find recent accounts and come up with a score based on how many likes they
# received, based on how much they posted and how old the accounts of the people
# who voted on them are.
sql = <<~SQL
SELECT u.id,
SUM(CASE
WHEN pa.id IS NOT NULL THEN
CASE
WHEN liked_by.id <= 0 THEN 0.0
WHEN liked_by.admin THEN 3.0
WHEN liked_by.moderator THEN 3.0
WHEN liked_by.trust_level = 4 THEN 2.0
WHEN liked_by.trust_level = 3 THEN 1.5
WHEN liked_by.trust_level = 2 THEN 1.0
And I think you tied one guy, but he won cause his name started with an e where yours starts with a j.
The other guy won by a landslide because he got a like from moderator.
1 Like
JerryM
(JerryM)
January 2, 2025, 8:27pm
3
Ill have to go through all of the discourse docs, I keep forgetting everything’s just on github now.
Feel free to close