summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/matches_controller.rb2
-rw-r--r--app/models/game_setting.rb13
-rw-r--r--app/models/tournament_setting.rb4
3 files changed, 18 insertions, 1 deletions
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
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