summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-10 13:27:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-10 13:27:51 +0000
commit490bfc293476317f6eae884a4740decd9261c190 (patch)
tree873f5e7d2031c5f5f66aa8bae322c6591533fbc6 /app/models/user.rb
parentc47293edb1d325e98a41fa0b0fd8b44798f28dbd (diff)
downloadredmine-490bfc293476317f6eae884a4740decd9261c190.tar.gz
redmine-490bfc293476317f6eae884a4740decd9261c190.zip
Stringify tokens.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9800 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 5640ac2fa..bcd46e96e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -167,7 +167,7 @@ class User < Principal
# Returns the user who matches the given autologin +key+ or nil
def self.try_to_autologin(key)
- tokens = Token.find_all_by_action_and_value('autologin', key)
+ tokens = Token.find_all_by_action_and_value('autologin', key.to_s)
# Make sure there's only 1 token that matches the key
if tokens.size == 1
token = tokens.first
@@ -341,12 +341,12 @@ class User < Principal
end
def self.find_by_rss_key(key)
- token = Token.find_by_value(key)
+ token = Token.find_by_value(key.to_s)
token && token.user.active? ? token.user : nil
end
def self.find_by_api_key(key)
- token = Token.find_by_action_and_value('api', key)
+ token = Token.find_by_action_and_value('api', key.to_s)
token && token.user.active? ? token.user : nil
end