summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-04-23 22:28:27 -0400
committerDavisLWebb <davislwebb@ymail.com>2014-04-23 22:28:27 -0400
commit47be7c86ca5193ffe4331fbb9358a9171abe748b (patch)
treedd66238ba93ffe23d7b4b8ab159d2c3d2c0c7567 /app/models/user.rb
parent8003c0f8326f231b6e0c8bb29feb48736271ea21 (diff)
Luke made the remote_username stuff work
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