summaryrefslogtreecommitdiff
path: root/app/models/tournament_setting.rb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-30 15:38:26 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-30 15:38:26 -0400
commit47bb545740937d50b72e0d1c420fcba4e64d6760 (patch)
tree886e361d01b1cdab7d3e8afed40eb76c6791ddfb /app/models/tournament_setting.rb
parentf1b2a1f25b839237ff1791ffc4586bc466409874 (diff)
Add #owned_by? to the models that didn't have it (when appropriate)
Diffstat (limited to 'app/models/tournament_setting.rb')
-rw-r--r--app/models/tournament_setting.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/tournament_setting.rb b/app/models/tournament_setting.rb
index 20d9842..48c607e 100644
--- a/app/models/tournament_setting.rb
+++ b/app/models/tournament_setting.rb
@@ -4,6 +4,10 @@ class TournamentSetting < ActiveRecord::Base
validates(:vartype, presence: true, numericality: {only_integer: true})
validates(:type_opt, presence: true, if: :needs_type_opt?)
+ def owned_by?(user)
+ self.tournament.owned_by?(user)
+ end
+
def needs_type_opt?
[
GameSetting.types[:pick_one_radio],