fixes #1136 (and a few other cases)

This commit is contained in:
albert
2013-03-30 11:51:17 -04:00
parent 85a5fcc658
commit cb1b021c2c
4 changed files with 4 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ class User < ActiveRecord::Base
module ClassMethods
def name_to_id(name)
Cache.get("uni:#{Cache.sanitize(name)}", 4.hours) do
select_value_sql("SELECT id FROM users WHERE lower(name) = ?", name.mb_chars.downcase.tr(" ", "_"))
select_value_sql("SELECT id FROM users WHERE lower(name) = ?", name.mb_chars.downcase.tr(" ", "_")).to_s
end
end