diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-26 23:21:57 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-26 23:21:57 -0400 |
commit | 4638a832b3b9da87bf076f4370e0d99bdf11ee78 (patch) | |
tree | edb643a43c94c59d75ded5ff2507f7f9b0809d76 | |
parent | add6074325e01b35f012f8fe783d5e4349c10a64 (diff) |
Fixed metaprogramming, I think. and added README for seeding
-rw-r--r-- | app/models/tournament.rb | 4 | ||||
-rw-r--r-- | lib/seeding/README.md | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 09a1abb..0a8ab8d 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -96,8 +96,8 @@ class Tournament < ActiveRecord::Base # YISSSSSS def self.make_methods(dir) - if @methods[dir].nil? or Rails.env.development? - @methods[dir] = Dir.glob("#{Rails.root}/lib/#{dir}/*.rb").map{|filename| filename.split('/').last.sub(/\.rb$/, '')} + if @methods.nil? or @methods[dir].nil? or Rails.env.development? + @methods[dir] = Dir.glob("#{Rails.root}/lib/#{dir}/*.rb").map{|filename| File.basename(filename) } end return @methods[dir] end diff --git a/lib/seeding/README.md b/lib/seeding/README.md index 2f12622..0afbb94 100644 --- a/lib/seeding/README.md +++ b/lib/seeding/README.md @@ -1,3 +1,4 @@ Files in this directory should implement the following interface: -- +- seed_matches(tournament) + take the matches of a tournament and the players in a tournament, assign players to teams, and teams to matches |