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-10 13:20:35 +02:00
parent ed82ab4117
commit 0124ae18c5
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('username = ? OR id = ?', name_or_id, name_or_id).first
where('users.username = ? OR users.id = ?', name_or_id, name_or_id.to_i).first
end
def build_user(attrs = {}, options= {})