summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-22 17:05:06 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-22 17:06:19 -0400
commit41e2a181bac54c965ef2bf7181289c21a83883f6 (patch)
tree9a63115dd7a3e9f44077da0edb2610af4bfe95c7 /app/models
parent44c8a2709c9eebe75f2d97ef2dee28a6f5966c9f (diff)
I HATE CODE
Diffstat (limited to 'app/models')
-rw-r--r--app/models/tournament_stage.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/tournament_stage.rb b/app/models/tournament_stage.rb
index a24d7b9..9fa6dcd 100644
--- a/app/models/tournament_stage.rb
+++ b/app/models/tournament_stage.rb
@@ -19,11 +19,15 @@ class TournamentStage < ActiveRecord::Base
def to_svg
set_scheduling
- return @scheduling.graph(self)
+ return @scheduling.graph
end
private
def set_scheduling
- @scheduling ||= "Scheduling::#{self.scheduling}".constantize.new(self)
+ if @scheduling.nil?
+ require "scheduling/#{self.scheduling}"
+ @scheduling = "Scheduling::#{self.scheduling.capitalize}".constantize.new(self)
+ end
+ return @scheduling
end
end