Fix User#by_username_or_id for postgres

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-12-26 10:09:15 +02:00
parent c797493e00
commit a389d77769
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ class User < ActiveRecord::Base
end
def by_username_or_id(name_or_id)
where('users.username = ? OR users.id = ?', name_or_id, name_or_id.to_i).first
where('users.username = ? OR users.id = ?', name_or_id.to_s, name_or_id.to_i).first
end
def build_user(attrs = {}, options= {})