summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-25 11:03:55 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-25 11:03:55 -0400
commit63a665823b8f05bf0b3a9acf9b18cc01252951fb (patch)
tree50cb9fa6118ee8ae04471c9bd117e15544b8a8f2
parentf14410d0e7ea249971265f3466ec246c62e6f3f5 (diff)
Touch up s/scores/statistics/
-rw-r--r--app/models/match.rb2
-rw-r--r--app/models/user.rb4
-rw-r--r--app/views/matches/show.html.erb2
3 files changed, 2 insertions, 6 deletions
diff --git a/app/models/match.rb b/app/models/match.rb
index 20a36a5..9045d67 100644
--- a/app/models/match.rb
+++ b/app/models/match.rb
@@ -1,6 +1,6 @@
class Match < ActiveRecord::Base
belongs_to :tournament_stage
- has_many :scores
+ has_many :statistics
has_and_belongs_to_many :teams
belongs_to :winner, class_name: "Team"
diff --git a/app/models/user.rb b/app/models/user.rb
index e5ae7ea..5aca8a6 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -23,10 +23,6 @@ class User < ActiveRecord::Base
self.permissions ||= Server.first.default_user_permissions
end
- def scores
- self.statistics.find_by_name(:score)
- end
-
def find_remote_username(game)
obj = self.remote_usernames.where(:game => game).first
if obj.nil?
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index e1fe29e..e87ce5d 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -47,7 +47,7 @@ function score_peers() {
<% if @match.status <= 1 %>
<li><%= user.user_name %></li>
<% else %>
- <li><%= user.user_name %> - SCORE: <%= Statistic.where(:name => "score", :user => user, :match => @match).first.value %></li>
+ <li><%= user.user_name %> - SCORE: <%= user.statistics.where(:name => "score", :match => @match).first.value %></li>
<% end %>
<% end %>
</ul></li>