summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-27 03:04:09 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-27 03:04:09 -0400
commit987b3e0d151d58c6b44e16e3ec4d13ce7f303fe7 (patch)
tree24971fe4b80e1dd4b6d27b9041945ffb7163748d /app/models
parent125d861972b9fcd99147d67b0e8fe4102f96190e (diff)
get the tournament creation page complete
Diffstat (limited to 'app/models')
-rw-r--r--app/models/tournament.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 47cda7e..97eee57 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -107,7 +107,7 @@ class Tournament < ActiveRecord::Base
end
def sampling_methods
- make_methods("sampling").collect do |name|
+ make_methods("sampling").select do |name|
"Sampling::#{name.camelcase}".constantize.works_with?(self.game)
end
end
@@ -120,6 +120,7 @@ class Tournament < ActiveRecord::Base
make_methods "seeding"
end
+ private
def make_methods(dir)
@@methods ||= {}
if @@methods[dir].nil? or Rails.env.development?