本番デプロイ設定: SSL, Kamal, API環境変数化, テスト修正
This commit is contained in:
@@ -22,14 +22,19 @@ class BoardsController < ApplicationController
|
||||
else
|
||||
return redirect_to game_path(@game), alert: "参加者ではないためアクセスできません" unless @current_participant
|
||||
|
||||
# 進行中:参加中の掲示板のみ(eager load で N+1 防止)
|
||||
@boards = @current_participant.boards.includes(:participants, :board_posts, :board_memberships).order(created_at: :desc)
|
||||
# 共通掲示板のフォールバック
|
||||
global_board = @game.boards.global.first
|
||||
if global_board && !@boards.include?(global_board)
|
||||
@boards = [ global_board ] + @boards
|
||||
if @game.status == "power_selection"
|
||||
# 国選択フェーズ:共通掲示板のみ表示
|
||||
@boards = @game.boards.global.includes(:participants, :board_posts, :board_memberships).to_a
|
||||
else
|
||||
# 進行中:参加中の掲示板のみ(eager load で N+1 防止)
|
||||
@boards = @current_participant.boards.includes(:participants, :board_posts, :board_memberships).order(created_at: :desc)
|
||||
# 共通掲示板のフォールバック
|
||||
global_board = @game.boards.global.first
|
||||
if global_board && !@boards.include?(global_board)
|
||||
@boards = [ global_board ] + @boards
|
||||
end
|
||||
@boards = @boards.sort_by { |b| b.global? ? 0 : 1 }
|
||||
end
|
||||
@boards = @boards.sort_by { |b| b.global? ? 0 : 1 }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -70,11 +75,11 @@ class BoardsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
@posts = @board.board_posts.includes(:participant).order(created_at: :desc)
|
||||
@posts = @board.board_posts.includes(participant: :user).order(created_at: :desc)
|
||||
@proposals = @board.board_proposals.includes(:proposer).order(created_at: :desc)
|
||||
@new_post = BoardPost.new
|
||||
@new_proposal = BoardProposal.new
|
||||
@active_members = @board.active_memberships.includes(:participant).map(&:participant)
|
||||
@active_members = @board.active_memberships.includes(participant: :user).map(&:participant)
|
||||
|
||||
# メンバー追加用:招待可能なプレイヤー一覧
|
||||
if @board.negotiation? && !@board.history_mode?
|
||||
|
||||
Reference in New Issue
Block a user