summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb6
1 files changed, 5 insertions, 1 deletions
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?