Skip to content

Commit

Permalink
Fixes bug where cores with unregistered players error the player list…
Browse files Browse the repository at this point in the history
…ing page.
  • Loading branch information
toomuchpete committed Apr 4, 2024
1 parent ca2597f commit e34e7d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/leagues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -454,14 +454,20 @@ def reg_data(reg)
grank[:answers] = GRank.convert_answers_to_text(reg.g_rank_result.answers)
# grank[:history] = reg.user.g_rank_results.map(&:score).slice(0,12).reverse
end

reg_url = nil
if reg.new_record? == false
reg_url = registration_path(reg)
end


{
id: reg._id.to_s,
name: u.name_with_pronouns,
name_without_pronouns: u.name,
email: u.email_address,
profile_url: user_path(u),
registration_url: registration_path(reg),
registration_url: reg_url,
status: reg.status,
rank: reg.rank.to_s.gsub(/\.0$/,''),
grank: grank,
Expand Down

0 comments on commit e34e7d6

Please sign in to comment.