Allow to delete puzzles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class Contest < ApplicationRecord
|
||||
belongs_to :user, dependent: :destroy
|
||||
has_many :puzzles
|
||||
belongs_to :user
|
||||
has_many :puzzles, dependent: :destroy
|
||||
end
|
||||
|
@@ -1,5 +1,5 @@
|
||||
class Puzzle < ApplicationRecord
|
||||
belongs_to :contest, dependent: :destroy
|
||||
belongs_to :contest
|
||||
has_one_attached :image
|
||||
validates :name, presence: true
|
||||
end
|
||||
|
Reference in New Issue
Block a user