summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-04-26 23:38:36 -0400
committerguntasgrewal <guntasgrewal@gmail.com>2014-04-26 23:38:36 -0400
commit506486a6a38fc73b49dd35077cfaafbdf891c664 (patch)
treef7eac08b42735c51692abd44c500711253a38aca /app/models
parent4638a832b3b9da87bf076f4370e0d99bdf11ee78 (diff)
Some shit I did
Diffstat (limited to 'app/models')
-rw-r--r--app/models/tournament.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 0a8ab8d..2d4d6b6 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -96,8 +96,9 @@ class Tournament < ActiveRecord::Base
# YISSSSSS
def self.make_methods(dir)
- 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) }
+ @methods ||= {}
+ if @methods[dir].nil? or Rails.env.development?
+ @methods[dir] = Dir.glob("#{Rails.root}/lib/#{dir}/*.rb").map{|filename| File.basename(filename, ".rb").humanize }
end
return @methods[dir]
end
@@ -117,5 +118,4 @@ class Tournament < ActiveRecord::Base
def self.seeding_methods
make_methods "seeding"
end
-
end