summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-24 19:03:41 -0400
committernfoy <nfoy@purdue.edu>2014-04-24 19:03:41 -0400
commit1b11684986136ee87da6242c3ba6aba5ef581510 (patch)
treed7ec999baced4836a9b3b7b31eee39cfe09410c9 /app/models
parent9823642115ef52f0a21b9466cef412098a124f3d (diff)
parentdb073045ff7cf5d8a2fb4a3349ed6a9a6ac019d3 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/models')
-rw-r--r--app/models/api_request.rb2
-rw-r--r--app/models/api_requests.rb2
-rw-r--r--app/models/tournament.rb12
3 files changed, 3 insertions, 13 deletions
diff --git a/app/models/api_request.rb b/app/models/api_request.rb
new file mode 100644
index 0000000..ffb7267
--- /dev/null
+++ b/app/models/api_request.rb
@@ -0,0 +1,2 @@
+class ApiRequest < ActiveRecord::Base
+end
diff --git a/app/models/api_requests.rb b/app/models/api_requests.rb
deleted file mode 100644
index 19c76e2..0000000
--- a/app/models/api_requests.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-class ApiRequests < ActiveRecord::Base
-end
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index e21ccb1..861be6c 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -1,20 +1,10 @@
class Tournament < ActiveRecord::Base
belongs_to :game
- has_many :tournament_stages
+ has_many :stages, class_name: "TournamentStage"
has_many :settings_raw, class_name: "TournamentSetting"
has_and_belongs_to_many :players, class_name: "User", association_foreign_key: "player_id", join_table: "players_tournaments"
has_and_belongs_to_many :hosts, class_name: "User", association_foreign_key: "host_id", join_table: "hosts_tournaments"
- def stages_ordered
- h = {}
- i = 1
- self.tournament_stages.order(:id).each do |s|
- h[i] = s
- i += 1
- end
- return h
- end
-
def settings
@settings ||= Settings.new(self)
end