app/controllers/game_actions_controller.rb
# This action is used to finish the turn
This action is used to finish the turn
This action is used to finish the turn
def phase_finished
		if @board.current_side == Board::ORF
			Board.transaction do
				@board.current_side = Board::WULF
				@board.save!
			end
		else
			Board.transaction do
				@board.current_side = Board::ORF
				@board.pawns.where( pawn_type: :art ).or( Pawn.where( pawn_type: :inf ) ).update_all( remaining_movement: 3 )
				@board.pawns.where( pawn_type: :cav ).update_all( remaining_movement: 6 )
				@board.turn += 1
				@board.save!
			end
		end
		redirect_to boards_path
	end
def phase_finished if @board . current_side == Board :: ORF Board . transaction do @board . current_side = Board :: WULF @board . save! end else Board . transaction do @board . current_side = Board :: ORF @board . pawns . where ( pawn_type : :art ) . or ( Pawn . where ( pawn_type : :inf ) ) . update_all ( remaining_movement : 3 ) @board . pawns . where ( pawn_type : :cav ) . update_all ( remaining_movement : 6 ) @board . turn += 1 @board . save! end end redirect_to boards_path end
This action is used to finish the turn
This action is used to finish the turn