From 69688e1990086fca58d5c85fc92f9d54e04ede8c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Apr 2014 17:35:50 -0400 Subject: Add {Game,Tournament}Setting.types to look up magic numbers --- app/models/game_setting.rb | 13 +++++++++++++ app/models/tournament_setting.rb | 4 ++++ 2 files changed, 17 insertions(+) (limited to 'app') diff --git a/app/models/game_setting.rb b/app/models/game_setting.rb index bff8d97..e701cae 100644 --- a/app/models/game_setting.rb +++ b/app/models/game_setting.rb @@ -1,3 +1,16 @@ class GameSetting < ActiveRecord::Base belongs_to :game + + alias_attribute :value, :default + + def self.types + return { + :text_short => 0, + :text_long => 1, + :pick_one_radio => 2, + :pick_several => 3, + :true_false => 4, + :pick_one_dropdown => 5, + } + end end diff --git a/app/models/tournament_setting.rb b/app/models/tournament_setting.rb index b3e6ace..9efaaea 100644 --- a/app/models/tournament_setting.rb +++ b/app/models/tournament_setting.rb @@ -1,3 +1,7 @@ class TournamentSetting < ActiveRecord::Base belongs_to :tournament + + def self.types + GameSetting.types + end end -- cgit v1.2.3 From c16c1b2928d0156fc00617a6abd81f4714045e5e Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 27 Apr 2014 18:25:04 -0400 Subject: Updated Seeing and Round Robin scheduling. --- app/controllers/matches_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 4a20df2..8b8e86d 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -286,7 +286,7 @@ class MatchesController < ApplicationController params.require(:match).permit(:status, :tournament_stage_id, :winner_id, :remote_id, :submitted_peer_evaluations, :update_action) end - # Turn of check_edit, since our #update is flexible + # Turn of check_edit, since our #update is flexible def check_edit set_match end -- cgit v1.2.3