フロントエンドプレイアブル
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
2026-02-15 14:57:17 +09:00
commit f25fd6f802
198 changed files with 10342 additions and 0 deletions

20
app/models/participant.rb Normal file
View File

@@ -0,0 +1,20 @@
class Participant < ApplicationRecord
belongs_to :user
belongs_to :game
# バリデーション
validates :user_id, uniqueness: {
scope: :game_id,
message: "既にこのゲームに参加しています"
}
validates :power, uniqueness: {
scope: :game_id,
message: "この国は既に選択されています"
}, allow_nil: true
validates :power, inclusion: {
in: %w[AUSTRIA ENGLAND FRANCE GERMANY ITALY RUSSIA TURKEY],
message: "無効な国です"
}, allow_nil: true
end