Add completion: order contestants by name + add email if present

This commit is contained in:
sto
2025-06-25 08:31:42 +02:00
parent c34b9654c8
commit 2cadc8eca5
4 changed files with 11 additions and 3 deletions

View File

@@ -28,6 +28,14 @@ class Contestant < ApplicationRecord
validates :name, presence: true
validates :time_seconds, presence: true
def form_name
if email.present?
"#{name} - #{email}"
else
name
end
end
private
def initialize_time_seconds_if_empty