summaryrefslogtreecommitdiff
path: root/app/models/tournament_stage.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_stage.rb
parentf1b2a1f25b839237ff1791ffc4586bc466409874 (diff)
Add #owned_by? to the models that didn't have it (when appropriate)
Diffstat (limited to 'app/models/tournament_stage.rb')
-rw-r--r--app/models/tournament_stage.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/tournament_stage.rb b/app/models/tournament_stage.rb
index 72aa14c..efb4d5c 100644
--- a/app/models/tournament_stage.rb
+++ b/app/models/tournament_stage.rb
@@ -12,6 +12,10 @@ class TournamentStage < ActiveRecord::Base
presence: true,
inclusion: {in: Tournament.new.seeding_methods})
+ def owned_by?(user)
+ self.tournament.owned_by?(user)
+ end
+
# A 1-indexed hash of matches
def matches_ordered
h = {}