From 987b3e0d151d58c6b44e16e3ec4d13ce7f303fe7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Apr 2014 03:04:09 -0400 Subject: get the tournament creation page complete --- app/models/tournament.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models') 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? -- cgit v1.2.3-2-g168b