summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-26 23:37:59 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-26 23:37:59 -0400
commitcbdccb99bcad74ffc98f6964fe504e20cfe0cdc2 (patch)
treeb40b77fe402129e8a0a92853fa88fa7c5d6bd158
parent4638a832b3b9da87bf076f4370e0d99bdf11ee78 (diff)
Added my fix
-rw-r--r--app/models/tournament.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 0a8ab8d..30a4895 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