From 1942d4307f392d61d13cdc488fecd523f55e427d Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Thu, 24 Apr 2014 00:46:42 -0400 Subject: Fixed Spacing, Scoring, and began implementing statistics --- app/models/user.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/user.rb b/app/models/user.rb index 5c0b5b1..e5ae7ea 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,7 +5,7 @@ class User < ActiveRecord::Base has_and_belongs_to_many :tournaments_hosted, class_name: "Tournament", foreign_key: "host_id", join_table: "hosts_tournaments" has_and_belongs_to_many :teams has_many :sessions - has_many :scores + has_many :statistics has_many :remote_usernames apply_simple_captcha @@ -23,6 +23,10 @@ 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? -- cgit v1.2.3-2-g168b