Add puzzles to contests
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-15 14:28:24 +01:00
parent eca2e46d23
commit 0cbd2e4fdc
10 changed files with 63 additions and 19 deletions

View File

@@ -1,3 +1,4 @@
class Contest < ApplicationRecord
belongs_to :user
belongs_to :user, dependent: :destroy
has_many :puzzles
end

View File

@@ -1,4 +1,5 @@
class Puzzle < ApplicationRecord
belongs_to :contest, dependent: :destroy
has_one_attached :image
validates :name, presence: true
end