summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-23 22:53:04 -0400
committernfoy <nfoy@purdue.edu>2014-04-23 22:53:04 -0400
commita6f801b7f5a2b9ca1b61ecc305a31f76be8c8238 (patch)
tree6f9fe728220b8d7d08e9da3ac3ac48f3a3128d5b /app/models/user.rb
parent107f1f65c93cbe118a69e76514327c4862c7d51d (diff)
parent41a93fad32677e3f351c0e16f0c704cbfbc5404e (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 138f73e..5c0b5b1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -24,9 +24,13 @@ class User < ActiveRecord::Base
end
def find_remote_username(game)
- obj = remote_username.where(:game => game)
- if obj.nil? and not game.parent.nil?
- return find_remote_username(game.parent)
+ obj = self.remote_usernames.where(:game => game).first
+ if obj.nil?
+ if game.parent.nil?
+ return nil
+ else
+ return find_remote_username(game.parent)
+ end
else
return obj.value
end