Add contestants
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Contest < ApplicationRecord
|
||||
belongs_to :user
|
||||
has_many :contestants, dependent: :destroy
|
||||
has_many :puzzles, dependent: :destroy
|
||||
end
|
||||
|
4
app/models/contestant.rb
Normal file
4
app/models/contestant.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Contestant < ApplicationRecord
|
||||
belongs_to :contest
|
||||
validates :name, presence: true
|
||||
end
|
Reference in New Issue
Block a user