Multiples traductions
All checks were successful
CI / scan_ruby (push) Successful in 16s
CI / scan_js (push) Successful in 14s
CI / lint (push) Successful in 14s
CI / test (push) Successful in 32s

This commit is contained in:
sto
2025-06-19 11:20:33 +02:00
parent 4645b45f5d
commit 79fb1edfaf
13 changed files with 106 additions and 32 deletions

View File

@@ -23,14 +23,16 @@ class Contestant < ApplicationRecord
belongs_to :contest
has_many :completions, dependent: :destroy
before_create :initialize_time_seconds
before_validation :initialize_time_seconds_if_empty
validates :name, presence: true
validates :time_seconds, presence: true
private
def initialize_time_seconds
self.time_seconds = 0
def initialize_time_seconds_if_empty
if !self.time_seconds
self.time_seconds = 0
end
end
end

View File

@@ -24,5 +24,4 @@ class Puzzle < ApplicationRecord
has_one_attached :image
validates :name, presence: true
validates :brand, presence: true
end