mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-03 21:33:48 +00:00
Re-generating one weight classes matches - NEED TO REFACTOR and NEED TO WRITE TESTS
Code is repeated in the following classes: GenerateTournamentMatches PoolToBracketMatchGeneration PoolToBracketGenerateLoserNames WipeTournamentMatches
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class WeightsController < ApplicationController
|
||||
before_action :set_weight, only: [:show, :edit, :update, :destroy]
|
||||
before_filter :check_access, only: [:new,:create,:update,:destroy,:edit]
|
||||
before_action :set_weight, only: [:show, :edit, :update, :destroy,:re_gen]
|
||||
before_filter :check_access, only: [:new,:create,:update,:destroy,:edit, :re_gen]
|
||||
|
||||
|
||||
# GET /weights/1
|
||||
@@ -69,6 +69,11 @@ class WeightsController < ApplicationController
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
def re_gen
|
||||
@tournament = @weight.tournament
|
||||
GenerateTournamentMatches.new(@tournament).generateWeight(@weight)
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
|
||||
Reference in New Issue
Block a user