summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
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