summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-27 19:12:07 -0400
committernfoy <nfoy@purdue.edu>2014-04-27 19:12:07 -0400
commit95542d38ddae5700e7fa35c166260a51ce17e46a (patch)
tree3ed1b9fcb793a426901586367dc5212819e9bff5 /app
parent07dbbeb404dedcf9733262ae2ce9cdddc086bb0e (diff)
parent8b1e26bf00c7e536def47ae4ef3441192f154aa8 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
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