summaryrefslogtreecommitdiff
path: root/app/models/tournament.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-03 16:24:36 -0400
committertkimia <tkimia@purdue.edu>2014-04-03 16:24:36 -0400
commitb62c07359a9cbc7bad93c375c50d266a40dfe539 (patch)
tree84977506985a747aac81f698ced6337300938588 /app/models/tournament.rb
parent9f19d0e16d7920e07255c0fbe596c518d1aa415f (diff)
Users can't join twice
Diffstat (limited to 'app/models/tournament.rb')
-rw-r--r--app/models/tournament.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 87b516e..4483535 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -9,7 +9,7 @@ class Tournament < ActiveRecord::Base
end
def joinable_by?(user)
- return ((not user.nil?) and user.in_group?(:player) and open?)
+ return ((not user.nil?) and user.in_group?(:player) and open? and !players.include?(user))
end
def join(user)